latents.base#

General-purpose base classes.

Classes

ArrayContainer

Base class for containers holding numpy.ndarray attributes.


class ArrayContainer[source]#

Base class for containers holding numpy.ndarray attributes.

Provides common functionality for deep copying and clearing array attributes, plus a custom __repr__ that shows shapes instead of full values.

Notes

This is an abstract base class with no attributes of its own. Subclasses should define their own __init__ that stores arrays as instance attributes. The copy() and clear() methods operate on all instance attributes.

copy() ArrayContainer[source]#

Return a deep copy of self.

Returns:
ArrayContainer

A deep copy of self.

clear() None[source]#

Set all attributes to None.