mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 08:37:06 +08:00
Adapt for iluvatar gpu (#2684)
This commit is contained in:
@@ -196,6 +196,9 @@ def convert_ndarray_dtype(np_array: np.ndarray,
|
||||
np.ndarray: converted numpy ndarray instance
|
||||
"""
|
||||
source_dtype = convert_dtype(np_array.dtype)
|
||||
if source_dtype == "uint16" and target_dtype == "bfloat16" and paddle.is_compiled_with_custom_device(
|
||||
"iluvatar_gpu"):
|
||||
return np_array.view(dtype=target_dtype)
|
||||
if source_dtype == "uint16" or target_dtype == "bfloat16":
|
||||
if paddle.is_compiled_with_xpu():
|
||||
# xpu not support bf16.
|
||||
|
Reference in New Issue
Block a user