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

Method GetShape

tensorflow/python/eager/pywrap_tfe_src.cc:1212–1224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1210}
1211
1212PyObject* PyTapeTensor::GetShape() const {
1213 if (shape_.index() == 0) {
1214 auto& shape = absl::get<0>(shape_);
1215 PyObject* py_shape = PyTuple_New(shape.dims());
1216 for (int i = 0; i < shape.dims(); ++i) {
1217 PyTuple_SET_ITEM(py_shape, i, PyLong_FromLong(shape.dim_size(i)));
1218 }
1219
1220 return py_shape;
1221 }
1222
1223 return py_vspace->GraphShape(absl::get<1>(shape_));
1224}
1225
1226class GradientTape
1227 : public tensorflow::eager::GradientTape<PyObject, PyBackwardFunction,

Callers 2

ZerosMethod · 0.45
OnesMethod · 0.45

Calls 4

GraphShapeMethod · 0.80
indexMethod · 0.45
dimsMethod · 0.45
dim_sizeMethod · 0.45

Tested by

no test coverage detected