| 238 | } |
| 239 | |
| 240 | bool ParseBoolValue(const string& key, PyObject* py_value, TF_Status* status, |
| 241 | unsigned char* value) { |
| 242 | *value = PyObject_IsTrue(py_value); |
| 243 | return true; |
| 244 | } |
| 245 | |
| 246 | // The passed in py_value is expected to be an object of the python type |
| 247 | // dtypes.DType or an int. |