MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / py_set_scope

Function py_set_scope

imperative/python/src/ops.cpp:164–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164int py_set_scope(PyObject* obj, PyObject* value, void* /* closure */) {
165 if (value == NULL) {
166 PyErr_SetString(PyExc_TypeError, "Cannot delete the attribute");
167 return -1;
168 }
169 try {
170 reinterpret_cast<PyOp(OpDef)*>(obj)->op->set_scope(
171 py::cast<std::string>(py::handle(value)));
172 }
173 CATCH_ALL(-1)
174 return 0;
175}
176
177PyGetSetDef PyOp(OpDef)::py_getsetters[] = {
178 {const_cast<char*>("scope"), py_get_scope, py_set_scope,

Callers

nothing calls this directly

Calls 1

set_scopeMethod · 0.80

Tested by

no test coverage detected