numeric_grad doesn't work with functions that have scalars as input
If numeric_grad gets as input a function f that has a parameter which is a scalar the code breaks at line 2959 of tensor/basic.py :
apt[i][:] = p
The reason is that apt[i] is not a vector, but a scalar and [:] makes no sense. If you simply change that to something like apt[i] = p the code breaks.
apt[i][:] = p
The reason is that apt[i] is not a vector, but a scalar and [:] makes no sense. If you simply change that to something like apt[i] = p the code breaks.
Leave a comment