Say we have a simple tensor operation pipeline as:
#w, x are 1D tensors and w.requires_grad=True
act = torch.matmul(w,x)
output = torch.max(0,act).bool().int()  #output = 1 if act > 0 else output = 0, which is simply a step function
Now if i want to apply autograd to such a computational operation using output.backward(), would it be possible to obtain gradients for w, and eventually optimize it ?