def identity_operation(x, operation_name=None):
zero = tf.zeros_like(input=x)
if dtype(x=zero) == "bool":
x = tf.math.logical_or(x=x, y=zero, name=operation_name)
elif dtype(x=zero) in ("int", "long", "float"):
x = tf.math.add(x=x, y=zero, name=operation_name)
After Change
def identity_operation(x, operation_name=None):
zero = tf.zeros_like(input=x)
if is_dtype(x=zero, dtype="bool"):
x = tf.math.logical_or(x=x, y=zero, name=operation_name)
elif dtype(x=zero) in ("int", "long", "float"):
x = tf.math.add(x=x, y=zero, name=operation_name)