Reputation: 1586
I want to make a tensor of moving window. I'm using a list comprehension, but, this is sequential making it extremely slow.
weight_list = [w[:, :, :, i : i + self.l_c] for i in range(n)]
I want to find
weight = torch.for_example.index_slice(w, start_indices=n, slice_length=self.l_c, dim=-1)
I've seen methods of "indexing". But not slicing. Is there a method for this?
Upvotes: 1
Views: 156