MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TensorId

Class TensorId

tensorflow/core/graph/tensor_id.h:33–58  ·  view source on GitHub ↗

Identifier for a tensor within a step. first == operation_name, second == output_index Note: does not own backing storage for name.

Source from the content-addressed store, hash-verified

31// first == operation_name, second == output_index
32// Note: does not own backing storage for name.
33struct TensorId : public std::pair<StringPiece, int> {
34 typedef std::pair<StringPiece, int> Base;
35
36 // Inherit the set of constructors.
37 using Base::pair;
38
39 // NOTE(skyewm): this is required on some platforms. I'm not sure why the
40 // using statement above isn't always sufficient.
41 TensorId() : Base() {}
42 TensorId(const SafeTensorId& id);
43
44 const StringPiece node() const { return first; }
45 int index() const { return second; }
46
47 string ToString() const {
48 if (second == Graph::kControlSlot) return strings::StrCat("^", first);
49 return strings::StrCat(first, ":", second);
50 }
51
52 struct Hasher {
53 public:
54 std::size_t operator()(const TensorId& x) const {
55 return Hash32(x.first.data(), x.first.size(), x.second);
56 }
57 };
58};
59
60TensorId ParseTensorName(const string& name);
61TensorId ParseTensorName(StringPiece name);

Callers 15

TEST_FFunction · 0.70
IntroduceJitterToTensorFunction · 0.50
SetPredicateMethod · 0.50
InputEdgeToTensorIdFunction · 0.50
HandleMergeMethod · 0.50
PopulateFrameMethod · 0.50
GetPredicateForMethod · 0.50
TrySimplifyMethod · 0.50
TF_DEVICELIST_METHODFunction · 0.50

Calls

no outgoing calls

Tested by 2

TEST_FFunction · 0.56