Dan_Erez:

class BinaryActivation(Function): @staticmethod def forward(ctx, x): ctx.save_for_backward(x) return x.round() @staticmethod def backward(ctx, grad_output): return grad_output.clone()


ok , that makes sense. Thanks!