| 2339 | } |
| 2340 | |
| 2341 | static PyObject* DAGAddTensorGet(PyObject *self, PyObject *args) { |
| 2342 | verifyRedisAILoaded(); |
| 2343 | PyDAGRunner *pyDag = (PyDAGRunner *)self; |
| 2344 | if(!_IsDagAPISupported(RedisAI_DAGAddTensorGet) || !_IsValidDag(pyDag)) { |
| 2345 | return NULL; |
| 2346 | } |
| 2347 | if(PyTuple_Size(args) != 1){ |
| 2348 | PyErr_SetString(GearsError, "Wrong number of args to TensorSet op"); |
| 2349 | return NULL; |
| 2350 | } |
| 2351 | PyObject* tensorName = PyTuple_GetItem(args, 0); |
| 2352 | if(!PyUnicode_Check(tensorName)){ |
| 2353 | PyErr_SetString(GearsError, "Tensor name argument must be a string"); |
| 2354 | return NULL; |
| 2355 | } |
| 2356 | |
| 2357 | const char* inputNameStr = PyUnicode_AsUTF8AndSize(tensorName, NULL); |
| 2358 | RedisAI_DAGAddTensorGet(pyDag->dag, inputNameStr); |
| 2359 | Py_INCREF(self); |
| 2360 | return self; |
| 2361 | } |
| 2362 | |
| 2363 | static RAI_DAGRunOp *_createModelRunOp(const char *modelNameStr, RAI_Error *err) { |
| 2364 |
nothing calls this directly
no test coverage detected