Closed ccshan closed 2 years ago
Could you explain what the problem was without requiresgrad?
Could you explain what the problem was without requiresgrad?
Just that no gradient gets computed and so weights.grad
throws an error. If you don't see that then we have some sort of version mismatch.
Isn't
dim=0
arbitrary?
Perhaps but the default dim=1
doesn't work for a 1D tensor like unfair=[0.6,0.4]
I cherry-picked your requires_grad fix into #152 but I'm not sold on a -n option that has dim=0 hard-coded into it...
Ok, does it make more sense to hard-code dim=ndim-1
?
I'm wary of any kind of hard-coding at all. Is this so that the gradient of the von Neumann example will work out to zero?
How about making the command-line option -n factor dim
?
I'm wary of any kind of hard-coding at all. Is this so that the gradient of the von Neumann example will work out to zero?
Yes (or rather 1e-8).
How about making the command-line option
-n factor dim
?
Ok.
Isn't
dim=0
arbitrary?