MCPcopy Create free account
hub / github.com/Gorilla-Lab-SCUT/tango / __init__

Method __init__

embedder.py:62–69  ·  view source on GitHub ↗
(self, num_input_channels=3, mapping_size=256, scale=10)

Source from the content-addressed store, hash-verified

60 """
61
62 def __init__(self, num_input_channels=3, mapping_size=256, scale=10):
63 super().__init__()
64
65 self._num_input_channels = num_input_channels
66 self._mapping_size = mapping_size
67 B = torch.randn((num_input_channels, mapping_size)) * scale
68 B_sort = sorted(B, key=lambda x: torch.norm(x, p=2))
69 self._B = torch.stack(B_sort) # for sape
70
71 def forward(self, x):
72 # assert x.dim() == 4, 'Expected 4D input (got {}D input)'.format(x.dim())

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected