#include <Names.h>
|
| TensorName (const std::string &tensor_name) |
| Constructor.
|
|
| TensorName (const std::string &node_name, const int tensor_index) |
|
const std::string & | name () const |
|
const std::string | nodeName () const |
| Returns node name from tensor name by removing, e.g., ":0".
|
|
Definition at line 26 of file Names.h.
◆ TensorName() [1/2]
moco::TensorName::TensorName |
( |
const std::string & |
tensor_name | ) |
|
|
inlineexplicit |
Constructor.
- Note
- If tensor_name does not have ":index", this constructor adds ":0" by default
Definition at line 34 of file Names.h.
35 {
37 {
38 _name.assign(tensor_name);
39 }
40 else
41 {
42 _name.assign(tensor_name + ":0");
43 }
44 }
const char * tensor_name(const circle::Tensor *tensor)
◆ TensorName() [2/2]
moco::TensorName::TensorName |
( |
const std::string & |
node_name, |
|
|
const int |
tensor_index |
|
) |
| |
|
inlineexplicit |
Definition at line 46 of file Names.h.
47 {
48 if (node_name.find(":") != std::string::npos)
49 {
50
51
52 throw std::runtime_error("Error: Node name has already tensor index:" + node_name);
53 }
54 else
55 {
56 _name.assign(node_name + ":" + std::to_string(tensor_index));
57 }
58 }
◆ name()
const std::string & moco::TensorName::name |
( |
| ) |
const |
|
inline |
◆ nodeName()
const std::string moco::TensorName::nodeName |
( |
| ) |
const |
|
inline |
Returns node name from tensor name by removing, e.g., ":0".
Definition at line 65 of file Names.h.
66 {
67 auto index = _name.find(
":");
68
69 if (
index != std::string::npos)
70 return _name.substr(0,
index);
71 else
72 {
73
74
75 throw std::runtime_error{"Error: Tensor name should be a 'name:number' format: " + _name};
76 }
77 };
loco::GraphInputIndex index(const TFPlaceholder *node)
References moco::index().
The documentation for this struct was generated from the following file:
- compiler/moco/lang/include/moco/Names.h