tf内部图描述graph
来源:互联网 发布:公租房信息管理 源码 编辑:程序博客网 时间:2024/05/22 16:02
// Thread compatible but not thread safe.class Graph { public: explicit Graph(const OpRegistryInterface* registry); explicit Graph(const FunctionLibraryDefinition& flib_def); ~Graph(); static const int kControlSlot; const VersionDef& versions() const; void set_versions(const VersionDef& versions); Node* AddNode(const NodeDef& node_def, Status* status); Node* CopyNode(Node* node); void RemoveNode(Node* node); const Edge* AddEdge(Node* source, int x, Node* dest, int y); const Edge* AddControlEdge(Node* source, Node* dest) { return AddEdge(source, kControlSlot, dest, kControlSlot); } void RemoveEdge(const Edge* edge); Status AddFunctionLibrary(const FunctionDefLibrary& fdef_lib); int num_nodes() const { return num_nodes_; } int num_op_nodes() const { DCHECK_GE(num_nodes_, 2); return num_nodes_ - 2; }
int num_edges() const { return num_edges_; } void ToGraphDefSubRange(GraphDef* graph_def, int from_node_id) const; void ToGraphDef(GraphDef* graph_def) const; string NewName(StringPiece prefix);
gtl::iterator_range<NodeIter> nodes() const; gtl::iterator_range<NodeIter> op_nodes() const; int num_node_ids() const { return nodes_.size(); } Node* FindNodeId(int id) const { return nodes_[id]; }
int num_edge_ids() const { return edges_.size(); } const Edge* FindEdgeId(int id) const { return edges_[id]; } GraphEdgesIterable edges() const { return GraphEdgesIterable(edges_); } enum { kSourceId = 0, kSinkId = 1 }; Node* source_node() const { return FindNodeId(kSourceId); } Node* sink_node() const { return FindNodeId(kSinkId); }
const OpRegistryInterface* op_registry() const { return &ops_; } const FunctionLibraryDefinition& flib_def() const { return ops_; }
void CheckDeviceNameIndex(int index) { DCHECK_GE(index, 0); DCHECK_LT(index, static_cast<int>(device_names_.size())); }
int InternDeviceName(const string& device_name);
const string& get_assigned_device_name(const Node& node) const { return device_names_[node.assigned_device_name_index()]; }
void set_assigned_device_name_index(Node* node, int device_name_index) { CheckDeviceNameIndex(device_name_index); node->assigned_device_name_index_ = device_name_index; }
void set_assigned_device_name(Node* node, const string& device_name) { node->assigned_device_name_index_ = InternDeviceName(device_name); }
Status IsValidNode(const Node* node) const; Status IsValidOutputTensor(const Node* node, int idx) const;
private: Node* AllocateNode(std::shared_ptr<NodeProperties> props, const Node* cost_node); void ReleaseNode(Node* node); FunctionLibraryDefinition ops_; const std::unique_ptr<VersionDef> versions_; core::Arena arena_; std::vector<Node*> nodes_;
int64 num_nodes_ = 0; std::vector<Edge*> edges_; int num_edges_ = 0; std::vector<Node*> free_nodes_; std::vector<Edge*> free_edges_;
int name_counter_ = 0; std::vector<string> device_names_; std::unordered_map<string, int> device_names_map_; TF_DISALLOW_COPY_AND_ASSIGN(Graph);};
阅读全文
0 0
- tf内部图描述graph
- tf.Graph
- tf.Graph()
- tf.Graph.name_scope
- 【Tensorflow】tf.Graph()函数
- tf中graph定义
- tf中graph简要实现
- Siebel 内部数据结构差异描述
- 【tensorflow】打印Tensorflow graph中的所有变量--tf.trainable_variables()
- 图Graph
- 图graph
- 图Graph
- s5pv210内部IROM bootloader功能描述
- TF
- tf
- Tensorflow使用技巧:通过graph.as_graph_def探索函数内部机制
- Graph 图模块 —— Graph Loading
- Graph 图构建 (Graph Constructor)
- bat批处理的注释语句
- Win10+Anaconda2+vs2015+cuDnn+CUDA8.0安装caffe时需要注意的问题
- Bit存储状态型数据
- canvas转base64/jpeg时,透明区域变成黑色背景的解决方案
- 如何快速转载CSDN中的博客
- tf内部图描述graph
- 李炎恢PHP第一二三四季VIP视频教程带讲义代码
- Android 屏幕旋转 处理 AsyncTask 和 ProgressDialog 的最佳方案
- ssh框架下ocupload实现一键上传功能
- Lenet-5网络结构
- python正则表达式模块re中search和match方法的区别
- Java 调用Native Method 和Library
- 判断APP当前版本号与提供的apk对比是否需要升级
- kali Linux---tomcal服务启动,开启github无证书验证模式,开启shhd服务