Update image_processing_diffusiondet.py
Browse files
image_processing_diffusiondet.py
CHANGED
@@ -200,18 +200,10 @@ def get_numpy_to_framework_fn(arr) -> Callable:
|
|
200 |
"""
|
201 |
if isinstance(arr, np.ndarray):
|
202 |
return np.array
|
203 |
-
if is_tf_available() and is_tf_tensor(arr):
|
204 |
-
import tensorflow as tf
|
205 |
-
|
206 |
-
return tf.convert_to_tensor
|
207 |
if is_torch_available() and is_torch_tensor(arr):
|
208 |
import torch
|
209 |
|
210 |
return torch.tensor
|
211 |
-
if is_flax_available() and is_jax_tensor(arr):
|
212 |
-
import jax.numpy as jnp
|
213 |
-
|
214 |
-
return jnp.array
|
215 |
raise ValueError(f"Cannot convert arrays of type {type(arr)}")
|
216 |
|
217 |
|
|
|
200 |
"""
|
201 |
if isinstance(arr, np.ndarray):
|
202 |
return np.array
|
|
|
|
|
|
|
|
|
203 |
if is_torch_available() and is_torch_tensor(arr):
|
204 |
import torch
|
205 |
|
206 |
return torch.tensor
|
|
|
|
|
|
|
|
|
207 |
raise ValueError(f"Cannot convert arrays of type {type(arr)}")
|
208 |
|
209 |
|