Esempio n. 1
0
 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
Esempio n. 2
0
 def forward(ctx, x: Tensor) -> Tensor:
     y = binary_sign(x)
     return y