diff --git a/ivy/functional/backends/tensorflow/creation.py b/ivy/functional/backends/tensorflow/creation.py index 4ee6f22cced5c..05f3487191575 100644 --- a/ivy/functional/backends/tensorflow/creation.py +++ b/ivy/functional/backends/tensorflow/creation.py @@ -93,6 +93,9 @@ def asarray( try: ret = tf.convert_to_tensor(obj, dtype) except (TypeError, ValueError): + obj = ( + obj if isinstance(obj, tf.Tensor) else tf.convert_to_tensor(obj, tf.float64) + ) ret = tf.cast(obj, dtype) return tf.identity(ret) if copy else ret diff --git a/ivy/functional/frontends/numpy/mathematical_functions/sums_products_differences.py b/ivy/functional/frontends/numpy/mathematical_functions/sums_products_differences.py index 361a55c5c0dd0..a863284396fd9 100644 --- a/ivy/functional/frontends/numpy/mathematical_functions/sums_products_differences.py +++ b/ivy/functional/frontends/numpy/mathematical_functions/sums_products_differences.py @@ -8,6 +8,7 @@ from_zero_dim_arrays_to_scalar, handle_numpy_out, ) +import ivy.functional.frontends.numpy as np_frontend @handle_numpy_out @@ -114,9 +115,10 @@ def prod( initial=None, where=True, ): - if ivy.is_array(where): + if where is not True: x = ivy.where(where, x, ivy.default(out, ivy.ones_like(x)), out=out) if initial is not None: + initial = np_frontend.array(initial, dtype=dtype).tolist() if axis is not None: s = ivy.to_list(ivy.shape(x, as_array=True)) s[axis] = 1