RockX  1.0.0
Functions
rockx_tensor_util.h File Reference
#include "rockx_type.h"

Go to the source code of this file.

Functions

int rockx_tensor_dtype_size (rockx_data_type type)
 
int rockx_tensor_elems_num (rockx_tensor_t *tensor)
 
int rockx_tensor_size (rockx_tensor_t *tensor)
 
void rockx_tensor_dump (rockx_tensor_t *tensor)
 
void write_tensor (const char *path, rockx_tensor_t *tensor)
 
rockx_ret_t rockx_tensor_init_from_image (rockx_image_t *img, rockx_tensor_t *tensor)
 
rockx_ret_t rockx_tensor_clone (rockx_tensor_t *tensor, rockx_tensor_t *dst_tensor)
 
rockx_ret_t rockx_tensor_release (rockx_tensor_t *tensor)
 

Function Documentation

◆ rockx_tensor_clone()

rockx_ret_t rockx_tensor_clone ( rockx_tensor_t tensor,
rockx_tensor_t dst_tensor 
)

Clone a Tensor

Parameters
tensor[in] Tensor to clone
dst_tensor[out] Cloned Tensor
Returns
rockx_ret_t

◆ rockx_tensor_dtype_size()

int rockx_tensor_dtype_size ( rockx_data_type  type)

Get Size of Data Type

Parameters
type[in] Data type
Returns
size of data type

◆ rockx_tensor_dump()

void rockx_tensor_dump ( rockx_tensor_t tensor)

Dump Tensor Info

Parameters
tensor[in] Input tensor

◆ rockx_tensor_elems_num()

int rockx_tensor_elems_num ( rockx_tensor_t tensor)

Get Tensor Elements Number

Parameters
tensor[in] Input tensor
Returns
Number of tensor elements

◆ rockx_tensor_init_from_image()

rockx_ret_t rockx_tensor_init_from_image ( rockx_image_t img,
rockx_tensor_t tensor 
)

Initial a Tensor From Image

Parameters
img[in] Input image
tensor[out] Initialed Tensor
Returns
rockx_ret_t

◆ rockx_tensor_release()

rockx_ret_t rockx_tensor_release ( rockx_tensor_t tensor)

Release Data Buffer of Tensor

Parameters
tensor[in] Tensor to release
Returns
rockx_ret_t

◆ rockx_tensor_size()

int rockx_tensor_size ( rockx_tensor_t tensor)

Get Tensor Data Buffer Size

Parameters
tensor[in] Input tensor
Returns
Size of tensor data buffer

◆ write_tensor()

void write_tensor ( const char *  path,
rockx_tensor_t tensor 
)

Write Tensor to File

Parameters
path[in] File path to Write
tensor[in] Tensor to Write