MCPcopy Create free account
hub / github.com/DeepGraphLearning/DiffPack / forward

Method forward

diffpack/layer.py:72–75  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

70 self.W = nn.Parameter(torch.randn(embedding_size // 2) * scale, requires_grad=False)
71
72 def forward(self, x):
73 x *= self.W[None, :] * 2 * np.pi
74 emb = torch.cat([torch.sin(x), torch.cos(x)], dim=-1)
75 return emb
76
77
78def get_timestep_embedding(embedding_type, embedding_dim, embedding_scale=10000):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected