MCPcopy Index your code
hub / github.com/DeepGraphLearning/S3F / tuple_index

Function tuple_index

s3f/gvp_layer.py:32–38  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

30
31
32def 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
41def randn(n, dims, device="cpu"):

Callers 1

forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected