Why do I get "TypeError: expected np.ndarray (got numpy.ndarray)" when I use torch.from_numpy() function?

Could you post a minimal code snippet to reproduce this error?