From abde0083036e561f81c862d18ee5dae20491b252 Mon Sep 17 00:00:00 2001 From: Olivia Nordquist Date: Mon, 11 Sep 2017 10:36:56 -0700 Subject: [PATCH] adding InputTensor class for symmetry with OutputTensor PiperOrigin-RevId: 168250085 --- tensorflow/core/graph/graph.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tensorflow/core/graph/graph.h b/tensorflow/core/graph/graph.h index 25875185e47..f825675392a 100644 --- a/tensorflow/core/graph/graph.h +++ b/tensorflow/core/graph/graph.h @@ -257,6 +257,15 @@ class Node { TF_DISALLOW_COPY_AND_ASSIGN(Node); }; +// Represents an input of a node, i.e., the `index`-th input to `node`. +struct InputTensor { + const Node* node; + int index; + + InputTensor(const Node* n, int i) : node(n), index(i) {} + InputTensor() : node(nullptr), index(0) {} +}; + // Represents an output of a node, i.e., the `index`-th output of `node`. Note // that a single `OutputTensor` can correspond to multiple `Edge`s if the output // is consumed by multiple destination nodes. @@ -268,8 +277,6 @@ struct OutputTensor { OutputTensor() : node(nullptr), index(0) {} }; -// TODO(skyewm): add InputTensor if/when necessary - class Edge { public: Node* src() const { return src_; }