tensorflow/python/framework/op_def_library_pybind.cc
// Converts the py:object to the AttributeType.
// ToAttributeType corrupts the value's representation when it fails. So this
// should be stored before hand if it is needed for error msgs.
Converts the py:object to the AttributeType.
ToAttributeType corrupts the value's representation when it fails. So this
should be stored before hand if it is needed for error msgs.
Converts the py : object to the AttributeType . ToAttributeType corrupts the value ' s representation when it fails . So this should be stored before hand if it is needed for error msgs .
py::object ToAttributeType(const py::handle& value, const AttributeType type) {
  auto result = ConvertPyObjectToAttributeType(value.ptr(), type);
  if (result == nullptr) {
    throw std::runtime_error("Failed to perform conversion.");
  }
  return py::reinterpret_borrow<py::object>(result.release());
}
py :: object ToAttributeType ( const py :: handle & value , const AttributeType type ) { auto result = ConvertPyObjectToAttributeType ( value . ptr ( ) , type ) ; if ( result == nullptr ) { throw std :: runtime_error ( " " ) ; } return py :: reinterpret_borrow < py :: object > ( result . release ( ) ) ; }
Converts the py:object to the AttributeType.
Converts the py : object to the AttributeType .