Source code for cvnets.modules.base_module

#
# For licensing see accompanying LICENSE file.
# Copyright (C) 2023 Apple Inc. All Rights Reserved.
#

from typing import Any

import torch
from torch import Tensor, nn


[docs]class BaseModule(nn.Module): """Base class for all modules"""
[docs] def __init__(self, *args, **kwargs): super(BaseModule, self).__init__()
[docs] def forward(self, x: Any, *args, **kwargs) -> Any: raise NotImplementedError
def __repr__(self): return "{}".format(self.__class__.__name__)