pytorch torch.Tensor.numpy()(从张量创建一个numpy数组,数组和张量共享相同内存)
生活随笔
收集整理的這篇文章主要介紹了
pytorch torch.Tensor.numpy()(从张量创建一个numpy数组,数组和张量共享相同内存)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
https://pytorch.org/docs/1.1.0/tensors.html?highlight=numpy#torch.Tensor.numpy
numpy() → numpy.ndarray Returns self tensor as a NumPy ndarray. This tensor and the returned ndarray share the same underlying storage. Changes to self tensor will be reflected in the ndarray and vice versa. 將自身張量作為NumPy ndarray返回。 該張量和返回的ndarray共享相同的基礎存儲。 自張量的變化將反映在ndarray中,反之亦然。總結
以上是生活随笔為你收集整理的pytorch torch.Tensor.numpy()(从张量创建一个numpy数组,数组和张量共享相同内存)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: pytorch torch.from_n
- 下一篇: Markdown如何插入LaTeX公式?