code: def convert_to_tensor(arr):
      tensor = torch.from_numpy(np.asarray(arr))
      if tensor.dtype == torch.double:
          tensor = tensor.float()
      return tensor
  
imports: from abc import ABC
  import numpy
  from ray.rllib.models.modelv2 import restore_original_dimensions
  from ray.rllib.models.preprocessors import get_preprocessor
  from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
  from ray.rllib.utils.framework import try_import_torch
label_desc: Use image node_id 1 for calling a global function with example usage: convert_to_tensor(arr) and returns: tensor