bitorch.quantizations.approx_sign.ApproxSign

class bitorch.quantizations.approx_sign.ApproxSign[source]

Module for applying the sign function with approx sign in backward pass

Methods

quantize

Forwards the tensor through the approx sign function.

Attributes

bit_width

name

quantize(x: Tensor) Tensor[source]

Forwards the tensor through the approx sign function.

Parameters:

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

Returns:

sign of tensor x

Return type:

torch.Tensor