code: def test__array_to_tensor(self) -> None:
      from ax.modelbridge import ModelBridge
  
      @dataclass
      class MockModelbridge(ModelBridge):
          def _array_to_tensor(
              self, array: Union[np.ndarray, List[float]]
          ):
              return _array_to_tensor(array=array)
  
      mock_modelbridge = MockModelbridge()
      arr = [0.0]
      res = _array_to_tensor(array=arr)
      self.assertEqual(len(res.size()), 1)
      self.assertEqual(res.size()[0], 1)
  
      res = _array_to_tensor(array=arr, modelbridge=mock_modelbridge)
      self.assertEqual(len(res.size()), 1)
      self.assertEqual(res.size()[0], 1)
  
imports: from dataclasses import dataclass
  from typing import List, Union
  import numpy
  import torch
  from ax.core.metric import Metric
  from ax.core.objective import MultiObjective
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig
  from ax.core.outcome_constraint import ObjectiveThreshold, OutcomeConstraint
  from ax.core.parameter import ChoiceParameter, ParameterType, RangeParameter
  from ax.core.risk_measures import RiskMeasure
  from ax.core.search_space import RobustSearchSpace, SearchSpace
  from ax.core.types import ComparisonOp
  from ax.exceptions.core import UserInputError
  from ax.modelbridge.modelbridge_utils import _array_to_tensor, extract_risk_measure, extract_robust_digest, feasible_hypervolume, process_contextual_datasets, RISK_MEASURE_NAME_TO_CLASS, transform_search_space
  from ax.modelbridge.registry import Cont_X_trans, Y_trans
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import not_none
  from ax.utils.testing.core_stubs import get_robust_search_space, get_search_space
  from botorch.acquisition.risk_measures import VaR
  from botorch.utils.datasets import ContextualDataset, SupervisedDataset
label_desc: Use image node_id 1 for calling the TestModelBridgeUtils obj's underlying member method code with example usage: obj.test__array_to_tensor() and returns: _array_to_tensor