def forward(ctx, x: Tensor) -> Tensor: ctx.save_for_backward(binary_sign(x).type( torch.int8)) # save some memory y = torch.abs(x) return y
def forward(ctx, x: Tensor) -> Tensor: y = binary_sign(x) return y