SHL 2.2.x
Loading...
Searching...
No Matches

Functions

int csinn_tensor_size (struct csinn_tensor *tensor)
 Get the number of elements in the tensor. More...
 
int csinn_tensor_byte_size (struct csinn_tensor *tensor)
 Get the number of bytes of elements in the tensor. More...
 
struct csinn_tensorcsinn_alloc_tensor (struct csinn_session *session)
 Allocate a tensor structure. More...
 
void csinn_realloc_quant_info (struct csinn_tensor *tensor, int quant_info_num)
 Reallocate a specified amount of quantitative information. More...
 
void csinn_tensor_copy (struct csinn_tensor *dest, struct csinn_tensor *src)
 Copying tensor, excluding data in tensor. More...
 
void csinn_free_tensor (struct csinn_tensor *tensor)
 Release a tensor structure. More...
 
int csinn_tensor_layout_convert (struct csinn_tensor *dest, struct csinn_tensor *src)
 Convert the layout of source and target tensor. More...
 
int csinn_tensor_data_convert (struct csinn_tensor *dest, struct csinn_tensor *src)
 Numerical conversion according to the data type of source and target tensor. More...
 

Detailed Description

Function Documentation

◆ csinn_tensor_size()

int csinn_tensor_size ( struct csinn_tensor tensor)

Get the number of elements in the tensor.

Parameters
[in]tensorThe tensor to be counted
Returns
Number of elements

◆ csinn_tensor_byte_size()

int csinn_tensor_byte_size ( struct csinn_tensor tensor)

Get the number of bytes of elements in the tensor.

Parameters
[in]tensorThe tensor to be counted
Returns
Number of bytes

◆ csinn_alloc_tensor()

struct csinn_tensor * csinn_alloc_tensor ( struct csinn_session session)

Allocate a tensor structure.

Parameters
[in]sessionReference session. If no reference is required, NULL can be passed in
Returns
Allocted tensor csinn_tensor*

◆ csinn_realloc_quant_info()

void csinn_realloc_quant_info ( struct csinn_tensor tensor,
int  quant_info_num 
)

Reallocate a specified amount of quantitative information.

Parameters
[in,out]tensorThe tensor to be operated
[in]quant_info_numNumber of quantitative information

◆ csinn_tensor_copy()

void csinn_tensor_copy ( struct csinn_tensor dest,
struct csinn_tensor src 
)

Copying tensor, excluding data in tensor.

Parameters
[out]destTarget tensor
[in]srcSource tensor

◆ csinn_free_tensor()

void csinn_free_tensor ( struct csinn_tensor tensor)

Release a tensor structure.

Parameters
[in]tensorThe tensor to be released

◆ csinn_tensor_layout_convert()

int csinn_tensor_layout_convert ( struct csinn_tensor dest,
struct csinn_tensor src 
)

Convert the layout of source and target tensor.

Parameters
[out]destTarget tensor
[in]srcSource tensor
Returns
The return value is greater than 0 on success

◆ csinn_tensor_data_convert()

int csinn_tensor_data_convert ( struct csinn_tensor dest,
struct csinn_tensor src 
)

Numerical conversion according to the data type of source and target tensor.

Parameters
[out]destTarget tensor
[in]srcSource tensor
Returns
The return value is greater than 0 on success