ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Convert.h File Reference
#include <loco.h>
#include <nncc/core/ADT/tensor/Shape.h>
#include <tensorflow/core/framework/graph.pb.h>
#include <string>

Go to the source code of this file.

Namespaces

namespace  plier
 
namespace  plier::tf
 

Enumerations

enum class  plier::tf::DataLayout { plier::tf::NHWC , plier::tf::NCHW }
 Class to represent TensorFlow "data_format" attr. More...
 

Functions

bool plier::tf::has_attr (const tensorflow::NodeDef &node, const std::string &attr_name)
 
bool plier::tf::has_attrs (const tensorflow::NodeDef &node, const std::vector< std::string > &attr_names)
 
tensorflow::DataType plier::tf::get_datatype_attr (const tensorflow::NodeDef &node, const std::string &attr_name)
 
const tensorflow::TensorShapeProto & plier::tf::get_shape_attr (const tensorflow::NodeDef &node, const std::string &attr_name)
 
const tensorflow::TensorProto & plier::tf::get_tensor_attr (const tensorflow::NodeDef &node, const std::string &attr_name)
 
const tensorflow::AttrValue_ListValue & plier::tf::get_list_attr (const tensorflow::NodeDef &node, const std::string &attr_name)
 
const std::string & plier::tf::get_string_attr (const tensorflow::NodeDef &node, const std::string &attr_name)
 
int64_t plier::tf::get_int_attr (const tensorflow::NodeDef &node, const std::string &attr_name)
 
float plier::tf::get_float_attr (const tensorflow::NodeDef &node, const std::string &attr_name)
 
bool plier::tf::get_bool_attr (const tensorflow::NodeDef &node, const std::string &attr_name)
 
std::vector< int64_t > plier::tf::as_int64_list (const tensorflow::AttrValue_ListValue &lv)
 
loco::DataType plier::tf::as_loco_datatype (const tensorflow::DataType dtype)
 
DataLayout plier::tf::as_data_layout (const std::string &tf_layout_str)
 @ brief Convert TF Data Layout string (e.g., "NHWC") to enum class for programming convenience
 
DataLayout plier::tf::get_data_layout (const tensorflow::NodeDef &node, const std::string &attr_name)
 
void plier::tf::copy_shape (const tensorflow::TensorShapeProto &tf_shape, nncc::core::ADT::tensor::Shape &to_shape)
 Copy shape defined in TensorShapeProto to angkor shape.