Indexes into a tuple (s, V) along the first dimension. :param idx: any object which can be used to index into a `torch.Tensor`
(x, idx)
| 30 | |
| 31 | |
| 32 | def tuple_index(x, idx): |
| 33 | ''' |
| 34 | Indexes into a tuple (s, V) along the first dimension. |
| 35 | |
| 36 | :param idx: any object which can be used to index into a `torch.Tensor` |
| 37 | ''' |
| 38 | return x[0][idx], x[1][idx] |
| 39 | |
| 40 | |
| 41 | def randn(n, dims, device="cpu"): |