hxtorch.spiking.handle.Handle_tensor

class hxtorch.spiking.handle.Handle_tensor(tensor: Union[None, torch.Tensor, hxtorch.spiking.observables.AnalogObservable] = None)

Bases: object

Handle for tensor

__init__(tensor: Union[None, torch.Tensor, hxtorch.spiking.observables.AnalogObservable] = None)None

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([tensor])

Initialize self.

clone(handle)

Overwrite contents from this with contents from handle.

holds(name)

Checks whether the tensor handle already holds a tensor with key name.

Attributes

tensor

clone(handle)None

Overwrite contents from this with contents from handle.

Parameters

handle – The handle to clone.

holds(name: str)bool

Checks whether the tensor handle already holds a tensor with key name.

Parameters

name – Key of reference to tensor.

Returns

Returns a bool indicating whether the data present at key name is not None.

tensor: Union[None, torch.Tensor, hxtorch.spiking.observables.AnalogObservable] = None