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

Function TensorShapeAsVector

tensorflow/c/eager/c_api_debug.cc:31–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace {
30
31std::vector<int64> TensorShapeAsVector(TFE_TensorHandle* handle,
32 TF_Status* status) {
33 std::vector<int64> shape;
34 int rank = TFE_TensorHandleNumDims(handle, status);
35 if (TF_GetCode(status) != TF_OK) {
36 return shape;
37 }
38 shape.reserve(rank);
39 for (int i = 0; i < rank; ++i) {
40 shape.push_back(TFE_TensorHandleDim(handle, i, status));
41 if (TF_GetCode(status) != TF_OK) {
42 return shape;
43 }
44 }
45 return shape;
46}
47
48} // namespace
49

Callers 1

c_api_debug.ccFile · 0.85

Calls 5

TFE_TensorHandleNumDimsFunction · 0.85
TF_GetCodeFunction · 0.85
TFE_TensorHandleDimFunction · 0.85
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected