mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
@@ -117,6 +117,9 @@ def get_tensor(input: Union[paddle.Tensor, np.ndarray, str], model_path=None) ->
|
||||
paddle.Tensor: Returns a PaddlePaddle tensor.
|
||||
|
||||
"""
|
||||
if "PySafeSlice" in str(type(input)):
|
||||
input = input.get()
|
||||
|
||||
if isinstance(input, paddle.Tensor):
|
||||
if input.place.is_cpu_place():
|
||||
return input.to(paddle.device.get_device())
|
||||
|
Reference in New Issue
Block a user