Skip to content

Commit

Permalink
style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eladsegal committed Nov 7, 2021
1 parent 68e3756 commit 05fed8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/transformers/feature_extraction_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ def convert_to_tensors(self, tensor_type: Optional[Union[str, TensorType]] = Non
raise ImportError("Unable to convert output to PyTorch tensors format, PyTorch is not installed.")
import torch

as_tensor = lambda value: torch.tensor(value if not isinstance(value, list) else np.array(value))
def as_tensor(value):
return torch.tensor(value if not isinstance(value, list) else np.array(value))

is_tensor = torch.is_tensor
elif tensor_type == TensorType.JAX:
if not is_flax_available():
Expand Down

0 comments on commit 05fed8b

Please sign in to comment.