adding InputTensor class for symmetry with OutputTensor

PiperOrigin-RevId: 168250085
This commit is contained in:
Olivia Nordquist 2017-09-11 10:36:56 -07:00 committed by TensorFlower Gardener
parent 0451032ca4
commit abde008303

View File

@ -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_; }