Hello,
So I have a CNN, with a softmax output, and a mask() function. The masks are like tensor([0,1,1]), tensor([1,1,0]) etc. The CNN has a softmaxed output over three classes.
pred = cnn(input_tensor.to(device)           #Returns PDF over three classes
mask = get_mask(*args)
final_pred = pred * mask.to(device)

Now, the mask returned by get_mask() is a deterministically mapped mask, and doesnt require any training/gradient. However, when i use,
loss = crtierion(final_pred, labels)
loss.backward()

I get the error
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
I even tried making mask = autograd.Variable(mask, requries_grad=False), but still the same error. Please help!
@ptrblck