Tensor

Overview

The definitions & operations about tensor. More…

Detailed Documentation

The definitions & operations about tensor.

Global Functions

const ov_element_type_econst ov_shape_tvoid \*ov_tensor_t \*\* ov_tensor_create_from_host_ptr(
    ,
    ,
    ,

    )

Constructs Tensor using element type and shape. Allocate internal host storage using default allocator.

Parameters:

type

Tensor element type

shape

Tensor shape

host_ptr

Pointer to pre-allocated host memory

tensor

A point to ov_tensor_t

Returns:

Status code of the operation: OK(0) for success.

const ov_element_type_econst ov_shape_tov_tensor_t \*\* ov_tensor_create(, , )

Constructs Tensor using element type and shape. Allocate internal host storage using default allocator.

Parameters:

type

Tensor element type

shape

Tensor shape

tensor

A point to ov_tensor_t

Returns:

Status code of the operation: OK(0) for success.

ov_tensor_t \*const ov_shape_t ov_tensor_set_shape(, )

Set new shape for tensor, deallocate/allocate if new total size is bigger than previous one.

Parameters:

shape

Tensor shape

tensor

A point to ov_tensor_t

Returns:

Status code of the operation: OK(0) for success.

const ov_tensor_t \*ov_shape_t \* ov_tensor_get_shape(, )

Get shape for tensor.

Parameters:

shape

Tensor shape

tensor

A point to ov_tensor_t

Returns:

Status code of the operation: OK(0) for success.

const ov_tensor_t \*ov_element_type_e \* ov_tensor_get_element_type(, )

Get type for tensor.

Parameters:

type

Tensor element type

tensor

A point to ov_tensor_t

Returns:

Status code of the operation: OK(0) for success.

const ov_tensor_t \*size_t \* ov_tensor_get_size(, )

the total number of elements (a product of all the dims or 1 for scalar).

Parameters:

elements_size

number of elements

tensor

A point to ov_tensor_t

Returns:

Status code of the operation: OK(0) for success.

const ov_tensor_t \*size_t \* ov_tensor_get_byte_size(, )

the size of the current Tensor in bytes.

Parameters:

byte_size

the size of the current Tensor in bytes.

tensor

A point to ov_tensor_t

Returns:

Status code of the operation: OK(0) for success.

const ov_tensor_t \*void \*\* ov_tensor_data(, )

Provides an access to the underlaying host memory.

Parameters:

data

A point to host memory.

tensor

A point to ov_tensor_t

Returns:

Status code of the operation: OK(0) for success.

ov_tensor_t \* ov_tensor_free()

Free ov_tensor_t.

Parameters:

tensor

A point to ov_tensor_t