diff --git a/tensorflow_probability/python/internal/backend/numpy/ops.py b/tensorflow_probability/python/internal/backend/numpy/ops.py index 4cd9ed8135..692bd2c7c3 100644 --- a/tensorflow_probability/python/internal/backend/numpy/ops.py +++ b/tensorflow_probability/python/internal/backend/numpy/ops.py @@ -311,7 +311,7 @@ def _default_convert_to_tensor_with_dtype(value, dtype, or np.issubdtype(dtype, np.floating)): raise MixedTypesError() if dtype == np.int32 and _is_int64(value): - raise _Int64ToInt32Error(np.array(value, dtype=dtype)) + raise _Int64ToInt32Error(np.array(value).astype(dtype)) if dtype == np.bool_: # Can't downcast an int to a bool raise TypeConversionError(value, dtype)