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

Function TFE_Py_RegisterVSpace

tensorflow/python/eager/pywrap_tfe_src.cc:1188–1210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1186bool HasAccumulator();
1187
1188PyObject* TFE_Py_RegisterVSpace(PyObject* e) {
1189 if (py_vspace != nullptr) {
1190 if (HasAccumulator()) {
1191 // Accumulators reference py_vspace, so we can't swap it out while one is
1192 // active. This is unlikely to ever happen.
1193 MaybeRaiseExceptionFromStatus(
1194 tensorflow::errors::Internal(
1195 "Can't change the vspace implementation while a "
1196 "forward accumulator is active."),
1197 nullptr);
1198 }
1199 delete py_vspace;
1200 }
1201
1202 py_vspace = new PyVSpace(e);
1203 auto status = py_vspace->Initialize();
1204 if (MaybeRaiseExceptionFromStatus(status, nullptr)) {
1205 delete py_vspace;
1206 return nullptr;
1207 }
1208
1209 Py_RETURN_NONE;
1210}
1211
1212PyObject* PyTapeTensor::GetShape() const {
1213 if (shape_.index() == 0) {

Callers

nothing calls this directly

Calls 3

InternalFunction · 0.85
InitializeMethod · 0.45

Tested by

no test coverage detected