oops

parent 93da0ef4
......@@ -92,7 +92,10 @@ class SequencePick(Selector):
def __call__(self, file, shape=None, axis=0, dtype=np.float, idx=None, strides=None, **kwargs):
assert axis==0, "memmap indexing on axis > 0 is not implemented yet"
idx = 0 if not self.random_idx else np.random.randint(max(0, shape[0] - self.sequence_length))
idx = 0
if self.random_idx:
if not shape[0] - self.sequence_length <= 0:
dx = np.random.randint(shape[0] - self.sequence_length)
offset = (idx * shape[1])*strides[1]
load_shape = shape if shape[0] < self.sequence_length else self.get_shape(shape)
data = np.memmap(file, dtype=dtype, mode='r', offset=offset, shape=load_shape)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment