Function MSTensorCreate

Function Documentation

MSTensorHandle MSTensorCreate(const char *name, MSDataType type, const int64_t *shape, size_t shape_num, const void *data, size_t data_len)

Create a tensor object.

Parameters
  • name[in] The name of the tensor.

  • type[in] The data type of the tensor.

  • shape[in] The shape of the tensor.

  • shape_num[in] The num of the shape.

  • data[in] The data pointer that points to allocated memory.

  • data_len[in] The length of the memory, in bytes.

Returns

Tensor object handle.