mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-13 14:03:20 +02:00
[indexing] maybe? cannot tell, tests are broken
This commit is contained in:
parent
e49bef9b94
commit
4886dfde08
1 changed files with 12 additions and 3 deletions
|
|
@ -246,9 +246,18 @@ class Param(Parameterizable, ObsAr):
|
||||||
# get a int-array containing all indices in the first axis.
|
# get a int-array containing all indices in the first axis.
|
||||||
if slice_index is None:
|
if slice_index is None:
|
||||||
slice_index = self._current_slice_
|
slice_index = self._current_slice_
|
||||||
indices = np.indices(self._realshape_, dtype=int)
|
try:
|
||||||
indices = indices[(slice(None),)+slice_index]
|
indices = np.indices(self._realshape_, dtype=int)
|
||||||
indices = np.rollaxis(indices, 0, indices.ndim)
|
indices = indices[(slice(None),)+slice_index]
|
||||||
|
indices = np.rollaxis(indices, 0, indices.ndim).reshape(-1,2)
|
||||||
|
#print indices_
|
||||||
|
#if not np.all(indices==indices__):
|
||||||
|
# import ipdb; ipdb.set_trace()
|
||||||
|
except:
|
||||||
|
print "Warning: extended indexing was used"
|
||||||
|
indices = np.indices(self._realshape_, dtype=int)
|
||||||
|
indices = indices[(slice(None),)+slice_index]
|
||||||
|
indices = np.rollaxis(indices, 0, indices.ndim)
|
||||||
return indices
|
return indices
|
||||||
def _max_len_names(self, gen, header):
|
def _max_len_names(self, gen, header):
|
||||||
gen = map(lambda x: " ".join(map(str, x)), gen)
|
gen = map(lambda x: " ".join(map(str, x)), gen)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue