def set_default_int(value_type):
try:
tf.as_dtype(value_type) // Test input value that it is eligable type.
__config._int = value_type
except TypeError:
raise TypeError("Expected tf or np dtype argument")
After Change
def set_default_int(value_type):
try:
tf_dtype = tf.as_dtype(value_type) // Test that it"s a tensorflow-valid dtype
except TypeError:
raise TypeError(f"{value_type} is not a valid tf or np dtype")
if not tf_dtype.is_integer: