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

Function ExtractTensors

tensorflow/core/grappler/costs/utils.cc:59–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59static std::vector<TensorProto> ExtractTensors(const AttrValue& attr_value) {
60 std::vector<TensorProto> tensors;
61 switch (attr_value.value_case()) {
62 case AttrValue::kTensor: {
63 tensors.push_back(attr_value.tensor());
64 break;
65 }
66 case AttrValue::kList: {
67 for (const auto& tensor_proto : attr_value.list().tensor()) {
68 tensors.push_back(tensor_proto);
69 }
70 break;
71 }
72 default: {
73 }
74 }
75 return tensors;
76}
77
78// Annotate the op_info inputs with extra information when possible (e.g. the
79// input value if it's known statically).

Callers 1

ExtractExtraPropertiesFunction · 0.85

Calls 3

listMethod · 0.80
push_backMethod · 0.45
tensorMethod · 0.45

Tested by

no test coverage detected