MCPcopy Create free account
hub / github.com/JasonLSC/GSCodec_Studio / create

Method create

gsplat/compression_simulation/mask.py:238–247  ·  view source on GitHub ↗
(config: MaskConfig, device: Optional[torch.device])

Source from the content-addressed store, hash-verified

236class AdaptiveMaskFactory:
237 @staticmethod
238 def create(config: MaskConfig, device: Optional[torch.device]) -> AdaptiveMaskBase:
239 if not config.enabled or config.strategy is None:
240 return NullAdaptiveMask()
241 if config.strategy == "learnable":
242 if device is None:
243 device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
244 return LearnableAdaptiveMask(config, device=device)
245 if config.strategy == "gradient":
246 return GradientAdaptiveMask(config)
247 raise ValueError(f"Unsupported mask strategy '{config.strategy}'")

Calls 3

NullAdaptiveMaskClass · 0.85