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

Method Ones

tensorflow/python/eager/pywrap_tfe_src.cc:1104–1116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1102 }
1103
1104 PyObject* Ones(const PyTapeTensor& tensor) const final {
1105 if (PyErr_Occurred()) {
1106 return nullptr;
1107 }
1108 PyObject* py_shape = tensor.GetShape();
1109 PyObject* py_dtype = tensor.GetPyDType();
1110 PyObject* arg_list = Py_BuildValue("OO", py_shape, py_dtype);
1111 PyObject* result = PyEval_CallObject(ones_fn_, arg_list);
1112 Py_DECREF(arg_list);
1113 Py_DECREF(py_dtype);
1114 Py_DECREF(py_shape);
1115 return result;
1116 }
1117
1118 PyObject* GraphShape(PyObject* tensor) const {
1119 PyObject* arg_list = Py_BuildValue("(O)", tensor);

Callers 8

test_OnesMethod · 0.80
testOnesMethod · 0.80
bias_initializerMethod · 0.80
bias_initializerMethod · 0.80
bias_initializerMethod · 0.80
InitialGradientsFunction · 0.80
ForwardpropFromTapeMethod · 0.80

Calls 2

GetPyDTypeMethod · 0.80
GetShapeMethod · 0.45

Tested by 3

test_OnesMethod · 0.64
testOnesMethod · 0.64