Skip to content

Instantly share code, notes, and snippets.

View lucifermorningstar1305's full-sized avatar
👨‍💻
Always Coding

Adityam Ghosh lucifermorningstar1305

👨‍💻
Always Coding
View GitHub Profile
@ferrine
ferrine / network_builder.py
Last active September 28, 2024 18:48
Pytorch models from yaml files
import torch.nn
import collections
class Builder(object):
def __init__(self, *namespaces):
self._namespace = collections.ChainMap(*namespaces)
def __call__(self, name, *args, **kwargs):
try:
return self._namespace[name](*args, **kwargs)