ONE - On-device Neural Engine
Loading...
Searching...
No Matches
tfinfo::v2 Namespace Reference

Data Structures

class  ShapeHint
 Class to represent axis and size of dims. User should enter axis and size of dim(s) when input tensor(s) contain(s) unknown dim(s). Such axis and size of dim(s) will be stored in ShapeHint. More...
 
class  TensorSignature
 Class to store input and output tensor information. More...
 

Typedefs

using TensorName = std::string
 
using TensorSignatures = std::vector< std::unique_ptr< TensorSignature > >
 

Enumerations

enum class  DataType { UNKNOWN , FLOAT32 }
 Supported Data Types. More...
 

Functions

TensorSignatures load (const char *info_path)
 Function to create TensorSignatures defined in info file.
 
TensorSignatures load (std::istream *stream, const char *path_for_error_msg)
 Function to create TensorSignatures from stream.
 

Typedef Documentation

◆ TensorName

using tfinfo::v2::TensorName = typedef std::string

Definition at line 75 of file TensorSignature.h.

◆ TensorSignatures

using tfinfo::v2::TensorSignatures = typedef std::vector<std::unique_ptr<TensorSignature> >

Definition at line 119 of file TensorSignature.h.

Enumeration Type Documentation

◆ DataType

enum class tfinfo::v2::DataType
strong

Supported Data Types.

Enumerator
UNKNOWN 
FLOAT32 

Definition at line 34 of file TensorSignature.h.

35{
36 UNKNOWN,
37
38 FLOAT32, // IEEE 32-bit floating point
39 /* To be added */
40};

Function Documentation

◆ load() [1/2]

TensorSignatures tfinfo::v2::load ( const char *  info_path)

Function to create TensorSignatures defined in info file.

Definition at line 155 of file TensorInfoLoader.cpp.

156{
157 std::ifstream stream(path, std::ios::in | std::ios::binary);
158
159 return load(&stream, path);
160}
TensorSignatures load(const char *info_path)
Function to create TensorSignatures defined in info file.

◆ load() [2/2]

TensorSignatures tfinfo::v2::load ( std::istream *  stream,
const char *  path_for_error_msg 
)

Function to create TensorSignatures from stream.

Definition at line 162 of file TensorInfoLoader.cpp.

163{
164 tfinfo_v2_proto::InfoDef info_def;
165
166 if (!load_text(stream, info_def))
167 {
168 throw oops::UserExn("Cannot parse the info file", "path", path_for_error_msg);
169 }
170
171 TensorSignatures tensors;
172
173 convert(info_def, tensors, path_for_error_msg);
174
175 return tensors;
176}
Exception to user.
Definition UserExn.h:42
std::vector< std::unique_ptr< TensorSignature > > TensorSignatures