3 ms·
It’s not just about access to underlying data - users might want to import from, or export to numpy array (e.g. for visualization, etc).
by p1esk 5y ago
It’s not just about access to underlying data - users might want to import from, or export to numpy array (e.g. for visualization, etc).
- lostmsu 5y agoBuffer protocol means PyTorch can have a torch.tensor method, that can create a tensor of anything implementing this protocol (which NumPy arrays do), and likewise numpy.array can be constructed out of PyTorch array because PyTorch Tensor implements this protocol. E.g. they don't need to know about each other (so no dependency), only about the protocol.