Is the code generally working for random inputs?
I just tested my code snippet and it still seems to work (at least I don’t get zero tensors).
Comparing the codes it seems you’ve just added the numpy array creation from the pd.DataFrame?