bitorch.quantizations.sign.Sign

class bitorch.quantizations.sign.Sign[source]

Module for applying the sign function with straight through estimator 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