MCPcopy Create free account
hub / github.com/NVlabs/RADIO / get_instance

Method get_instance

radio/feature_normalizer.py:103–108  ·  view source on GitHub ↗
(dtype: torch.dtype, device: torch.device)

Source from the content-addressed store, hash-verified

101
102 @staticmethod
103 def get_instance(dtype: torch.dtype, device: torch.device):
104 instance = NullIntermediateFeatureNormalizer.instances.get((dtype, device), None)
105 if instance is None:
106 instance = NullIntermediateFeatureNormalizer(dtype, device)
107 NullIntermediateFeatureNormalizer.instances[(dtype, device)] = instance
108 return instance
109
110 def forward(self, x: torch.Tensor, index: int, rot_index: int = None, skip: Optional[int] = None) -> InterFeatState:
111 return InterFeatState(x, self.alpha)

Callers 1

forward_intermediatesFunction · 0.80

Tested by

no test coverage detected