bitorch.layers.extensions.layer_container.LayerContainer

class bitorch.layers.extensions.layer_container.LayerContainer(impl_class: Type[T], *args: Any, **kwargs: Any)[source]

This class wraps another layer - but the internally contained class can be swapped out during runtime.

Methods

__init__

Wrap a new object based on the given class, positional arguments, and keyword arguments.

replace_layer_implementation

Replace the internally stored layer object with the given one.

Attributes

internal_variable_names

layer_implementation

Access the internally wrapped layer object directly.

patch

recipe

__call__(*args: Any, **kwargs: Any) Any[source]

Call self as a function.

__init__(impl_class: Type[T], *args: Any, **kwargs: Any) None[source]

Wrap a new object based on the given class, positional arguments, and keyword arguments. :param impl_class: class of the new object :param *args: positional arguments of the new object :param **kwargs: keyword arguments of the new object

property layer_implementation: T

Access the internally wrapped layer object directly. :returns: the internal layer object

replace_layer_implementation(new_implementation: T) None[source]

Replace the internally stored layer object with the given one. :param new_implementation: new class which should replace the previous implementation.