MCPcopy Create free account
hub / github.com/DeepGraphLearning/S3F / _merge

Function _merge

s3f/gvp_layer.py:79–87  ·  view source on GitHub ↗

Merges a tuple (s, V) into a single `torch.Tensor`, where the vector channels are flattened and appended to the scalar channels. Should be used only if the tuple representation cannot be used. Use `_split(x, nv)` to reverse.

(s, v)

Source from the content-addressed store, hash-verified

77
78
79def _merge(s, v):
80 '''
81 Merges a tuple (s, V) into a single `torch.Tensor`, where the
82 vector channels are flattened and appended to the scalar channels.
83 Should be used only if the tuple representation cannot be used.
84 Use `_split(x, nv)` to reverse.
85 '''
86 v = torch.reshape(v, v.shape[:-2] + (3*v.shape[-2],))
87 return torch.cat([s, v], -1)
88
89
90class GVP(nn.Module):

Callers 1

messageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected