Spaces:
Runtime error
Runtime error
File size: 610 Bytes
ad93086 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import torch
from diffusers.configuration_utils import ConfigMixin, register_to_config
from torch import nn
class ModuleDict(torch.nn.Module):
def __init__(self, module_dict):
super(ModuleDict, self).__init__()
for name, module in module_dict.items():
self.add_module(name, module)
class ObjectDict:
def __init__(self, module_dict):
for name, module in module_dict.items():
setattr(self, name, module)
class Dummy(nn.Module, ConfigMixin):
config_name = 'config.json'
@register_to_config
def __init__(self):
super().__init__()
|