Source code for qualia_codegen_core.graph.layers.TBaseLayer

from __future__ import annotations

import sys
from abc import ABC
from collections import OrderedDict
from dataclasses import dataclass

from qualia_codegen_core.typing import TYPE_CHECKING

if TYPE_CHECKING:
    from qualia_codegen_core.typing import DTypes, NDArrayFloatOrInt, Shapes

if sys.version_info >= (3, 12):
    from typing import override
else:
    from typing_extensions import override


[docs] @dataclass(eq=False) class TBaseLayer(ABC): input_shape: Shapes output_shape: Shapes output_dtype: DTypes name: str @override def __eq__(self, other: object) -> bool: raise NotImplementedError @override def __hash__(self) -> int: raise NotImplementedError @property def weights(self) -> OrderedDict[str, NDArrayFloatOrInt]: # If adding any weights in a child layer, fill dict with same name as attribute return OrderedDict()