bitorch.quantizations.sign.SignFunction

class bitorch.quantizations.sign.SignFunction(*args, **kwargs)[source]

Methods

forward

Binarize the input tensor using the sign function.

Attributes

static forward(ctx: BackwardCFunction, input_tensor: Tensor) Tensor[source]

Binarize the input tensor using the sign function.

Parameters:
  • ctx (Any) – autograd context

  • input_tensor (torch.Tensor) – input tensor

Returns:

the sign tensor

Return type:

torch.Tensor