bitorch.quantizations.ste_heaviside.SteHeaviside

class bitorch.quantizations.ste_heaviside.SteHeaviside[source]

Module for applying the SteHeaviside quantization, using an ste in backward pass

Methods

quantize

Forwards the tensor through the sign function.

Attributes

bit_width

name

quantize(x: Tensor) Tensor[source]

Forwards the tensor through the sign function.

Parameters:

x (torch.Tensor) – tensor to be forwarded.

Returns:

sign of tensor x

Return type:

torch.Tensor