Spaces:
Runtime error
Runtime error
File size: 445 Bytes
b334e29 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from mmcv.utils import Registry, build_from_cfg
TRANSFORMER = Registry('Transformer')
POSITIONAL_ENCODING = Registry('Position encoding')
def build_transformer(cfg, default_args=None):
"""Builder for Transformer."""
return build_from_cfg(cfg, TRANSFORMER, default_args)
def build_positional_encoding(cfg, default_args=None):
"""Builder for Position Encoding."""
return build_from_cfg(cfg, POSITIONAL_ENCODING, default_args)
|