| 98 | } |
| 99 | |
| 100 | bool IsPyDimension(PyObject* obj) { |
| 101 | const char* tp_name = obj->ob_type->tp_name; |
| 102 | if (strcmp(tp_name, "Dimension") != 0) return false; |
| 103 | bool ret = str_util::EndsWith( |
| 104 | PyRepr(PyType(obj)), |
| 105 | "tensorflow.python.framework.tensor_shape.Dimension'>"); |
| 106 | return ret; |
| 107 | } |
| 108 | |
| 109 | // Sets *elem to a NEW reference to an element in seq on success. |
| 110 | // REQUIRES: PySequence_Check(seq) && PySequence_Length(seq) > 0. |
no test coverage detected