diff --git a/ivy/functional/backends/tensorflow/creation.py b/ivy/functional/backends/tensorflow/creation.py index 4a96058aa5dff..bdcbddf911f89 100644 --- a/ivy/functional/backends/tensorflow/creation.py +++ b/ivy/functional/backends/tensorflow/creation.py @@ -93,9 +93,12 @@ def asarray( with tf.device(device): if tf.is_tensor(obj): ret = tf.cast(obj, dtype) if obj.dtype != dtype else obj - elif dtype.is_integer and np.issubdtype( - (obj_np := np.array(obj)).dtype, np.floating + elif ( + dtype is not None + and dtype.is_integer + and np.issubdtype(np.array(obj).dtype, np.floating) ): + obj_np = np.array(obj) ret = tf.convert_to_tensor(obj_np, dtype) else: ret = tf.convert_to_tensor(obj, dtype)