bitorch.layers.extensions.layer_implementation.DefaultImplementationMixin¶
- class bitorch.layers.extensions.layer_implementation.DefaultImplementationMixin(*args: Any, **kwargs: Any)[source]¶
Defines the class interface of a default layer implementation of a certain layer type.
Methods
Returns whether this layer class supports the implementation of a given layer recipe.
Create a new layer based on a given layer recipe (can be expected to be from the default category).
- returns:
whether this implementation is the default implementation of the current layer type
- classmethod can_clone(recipe: LayerRecipe) Tuple[bool, str] [source]¶
Returns whether this layer class supports the implementation of a given layer recipe.
- Parameters:
recipe (LayerRecipe) – the layer which should be checked for cloning
- Returns:
Whether the layer can be cloned or not and an info message if it can not be cloned
- classmethod create_clone_from(recipe: LayerRecipe, device: Optional[device] = None) Any [source]¶
Create a new layer based on a given layer recipe (can be expected to be from the default category).
- Parameters:
recipe – the layer which should be cloned
device – the device on which the layer is going to be run
- Returns:
A clone of the LayerRecipe in the current class implementation