Skip to content

Commit

Permalink
removing assertion from tf.cast frontend function
Browse files Browse the repository at this point in the history
  • Loading branch information
sherry30 authored and sushmanthreddy committed Aug 17, 2023
1 parent 2119f24 commit b8a1282
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions ivy/functional/frontends/tensorflow/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,4 @@ def as_dtype(type_value):
@handle_tf_dtype
@to_ivy_arrays_and_back
def cast(x, dtype, name=None):
if ivy.is_array(x):
assert ivy.can_cast(x.dtype, dtype), "Cannot cast from {} to {}".format(
x.dtype, dtype
)
return ivy.astype(x, dtype, copy=False)
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_tensorflow_as_dtype(
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("valid"),
),
dtype=helpers.get_dtypes("valid"),
dtype=helpers.get_dtypes("valid", full=False),
test_with_out=st.just(False),
)
def test_tensorflow_cast(
Expand Down

0 comments on commit b8a1282

Please sign in to comment.