MSTensor¶
import com.mindspore.lite.MSTensor;
MSTensor定义了MindSpore Lite中的张量。
公有成员函数¶
getShape¶
public int[] getShape()
获取MindSpore Lite MSTensor的形状。
返回值
一个包含MindSpore Lite MSTensor形状数值的整型数组。
getDataType¶
public int getDataType()
DataType在com.mindspore.lite.DataType中定义。
返回值
MindSpore Lite MSTensor类的MindSpore Lite DataType。
getByteData¶
public byte[] getByteData()
获得MSTensor的输出数据,数据类型为byte类型。
返回值
包含所有MSTensor输出数据的byte类型数组。
getFloatData¶
public float[] getFloatData()
获得MSTensor的输出数据,数据类型为float类型。
返回值
包含所有MSTensor输出数据的float类型数组。
getLongData¶
public long[] getLongData()
获得MSTensor的输出数据,数据类型为long类型。
返回值
包含所有MSTensor输出数据的long类型数组。
setData¶
public void setData(byte[] data)
设定MSTensor的输入数据。
参数
data
: byte[]类型的输入数据。
public void setData(ByteBuffer data)
设定MSTensor的输入数据。
参数
data
: ByteBuffer类型的输入数据。