17#include "mio_circle/Helper.h"
26bool is_valid(const ::circle::OperatorCode *opcode)
28 ::circle::BuiltinOperator code = opcode->builtin_code();
29 return (::circle::BuiltinOperator_MIN <= code && code <= ::circle::BuiltinOperator_MAX);
34 ::circle::BuiltinOperator code = opcode->builtin_code();
35 return (code == ::circle::BuiltinOperator_CUSTOM);
44 std::ostringstream oss;
51 if (!opcode->custom_code())
52 return "(invalid custom)";
54 std::string custom_op =
"CUSTOM(";
55 custom_op += opcode->custom_code()->c_str();
60 ::circle::BuiltinOperator code = opcode->builtin_code();
61 return ::circle::EnumNameBuiltinOperator(code);
66 return ::circle::EnumNameTensorType(tensor->type());
71 static const char *kEmptyTensorName =
"(noname)";
73 auto name = tensor->name();
77 return kEmptyTensorName;
const char * tensor_name(const ::circle::Tensor *tensor)
std::string opcode_name(const ::circle::OperatorCode *opcode)
const char * tensor_type(const ::circle::Tensor *tensor)
bool is_custom(const ::circle::OperatorCode *opcode)
bool is_valid(const ::circle::OperatorCode *opcode)