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

Function MaybeNotifyVariableAccessed

tensorflow/python/eager/pywrap_tfe_src.cc:2617–2625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2615}
2616
2617void MaybeNotifyVariableAccessed(PyObject* input) {
2618 DCHECK(CheckResourceVariable(input));
2619 DCHECK(PyObject_HasAttrString(input, "_trainable"));
2620
2621 tensorflow::Safe_PyObjectPtr trainable(
2622 PyObject_GetAttrString(input, "_trainable"));
2623 if (trainable.get() == Py_False) return;
2624 TFE_Py_TapeVariableAccessed(input);
2625}
2626
2627bool ReadVariableOp(const FastPathOpExecInfo& parent_op_exec_info,
2628 PyObject* input, tensorflow::Safe_PyObjectPtr* output,

Callers 1

ReadVariableOpFunction · 0.85

Calls 3

CheckResourceVariableFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected