forked from mindspore-Ecosystem/mindspore
!40310 fix tensor api
Merge pull request !40310 from lianliguang/code_docs_ms
This commit is contained in:
commit
ea865d8eb7
|
@ -4,7 +4,9 @@ mindspore.Tensor.from_numpy
|
|||
.. py:method:: mindspore.Tensor.from_numpy(array)
|
||||
:staticmethod:
|
||||
|
||||
通过不复制数据的方式将Numpy数组转换为张量。
|
||||
将Numpy数组转换为张量。
|
||||
|
||||
当数据为非C连续时,数据会被拷贝成C连续数据后创建张量,否则则通过不复制数据的方式将Numpy数组转换为张量。
|
||||
|
||||
参数:
|
||||
- **array** (numpy.array) - 输入数组。
|
||||
|
|
|
@ -418,8 +418,9 @@ class Tensor(Tensor_):
|
|||
@staticmethod
|
||||
def from_numpy(array):
|
||||
"""
|
||||
Convert numpy array to Tensor without copy data.
|
||||
|
||||
Convert numpy array to Tensor.
|
||||
If the data is not C contiguous, the data will be copied to C contiguous to construct the tensor.
|
||||
Otherwise, The tensor will be constructed using this numpy array without copy.
|
||||
Args:
|
||||
array (numpy.array): The input array.
|
||||
|
||||
|
|
Loading…
Reference in New Issue