ONE - On-device Neural Engine
Loading...
Searching...
No Matches
package.infer Namespace Reference

Data Structures

class  session
 

Functions

 num_elems (tensor_info)
 
 tensorinfo ()
 

Function Documentation

◆ num_elems()

package.infer.num_elems (   tensor_info)
Get the total number of elements in nnfw_tensorinfo.dims.

Definition at line 8 of file infer.py.

8def num_elems(tensor_info):
9 """Get the total number of elements in nnfw_tensorinfo.dims."""
10 n = 1
11 for x in range(tensor_info.rank):
12 n *= tensor_info.dims[x]
13 return n
14
15
uint64_t num_elems(const nnfw_tensorinfo *tensor_info)
Get the total number of elements in nnfw_tensorinfo->dims.

Referenced by package.infer.session.set_inputs(), and package.infer.session.set_outputs().

◆ tensorinfo()

package.infer.tensorinfo ( )

Definition at line 57 of file infer.py.

57def tensorinfo():
58 return libnnfw_api_pybind.nnfw_tensorinfo()
tensor info describes the type and shape of tensors