I am probably missing something obvious here.
grid_sizes in the calculations to go from the activations to the predictions. So the gradient has to flow through them so that we can backpropagate the error. But this is essentially a constant. Why does it have to be a variable? Does it have to be a variable?
If I change
grid_sizes to be a
FloatTensor I get the error above. So seems it either wants a
float or a
I realize that this will change in PyTorch 0.4, but could this be that gradients just cannot float through tensors that are not
I now tried running the code with grid_sizes being just a Python float and it works. So this seems like a limitation of PyTorch tensors that they can’t be used as constants? You either need a Variable or some numeric value as plain Tensors cannot be part of the computational graph as they lack some necessary functionality?
Edit: But we cannot keep the grid_sizes as a Python
float since down the road we want different sizes of anchors per each grid cell… so if I am reading this right, because we cannot use
floats in our situation, np.arrays cannot be part of the computational graph… Tensors are of limits cause they don’t allow the flow of gradients through them… we need to use Variables?