Download model/common/module_attr_mixin.py from ducido/diffusion_policy_gbc: direct link, hf CLI and curl.
- Browser
- Download file 334 Bytes
-
https://huggingface.co/ducido/diffusion_policy_gbc/resolve/main/model/common/module_attr_mixin.py
- Command line
-
hf download hf://ducido/diffusion_policy_gbc/model/common/module_attr_mixin.py
-
curl -L -o module_attr_mixin.py https://huggingface.co/ducido/diffusion_policy_gbc/resolve/main/model/common/module_attr_mixin.py
334 Bytes
| import torch.nn as nn | |
| class ModuleAttrMixin(nn.Module): | |
| def __init__(self): | |
| super().__init__() | |
| self._dummy_variable = nn.Parameter() | |
| def device(self): | |
| return next(iter(self.parameters())).device | |
| def dtype(self): | |
| return next(iter(self.parameters())).dtype | |