code: def _convert_trials_to_tensors(
      trials: list[FrozenTrial],
  ) -> tuple[torch.Tensor, torch.Tensor]:
      """Convert a list of FrozenTrial objects to tensors inputs and bounds.
  
      This function assumes the following condition for input trials:
      - any categorical param is converted to a float or int one;
      - log is unscaled for any float/int distribution;
      - the state is COMPLETE for any trial;
      - direction is MINIMIZE for any trial.
      """
      search_space = intersection_search_space(trials)
      sorted_params = sorted(search_space.keys())
  
      x = []
      for trial in trials:
          assert trial.state == TrialState.COMPLETE
          x_row = []
          for param in sorted_params:
              distribution = search_space[param]
  
              assert not _is_distribution_log(distribution)
              assert not isinstance(
                  distribution, CategoricalDistribution
              )
  
              param_value = float(trial.params[param])
              x_row.append(param_value)
  
          x.append(x_row)
  
      min_bounds = []
      max_bounds = []
      for param, distribution in search_space.items():
          assert isinstance(
              distribution, (FloatDistribution, IntDistribution)
          )
          min_bounds.append(distribution.low)
          max_bounds.append(distribution.high)
      bounds = [min_bounds, max_bounds]
  
      return torch.tensor(x, dtype=torch.float64), torch.tensor(
          bounds, dtype=torch.float64
      )
  
file_path: optuna/optuna/terminator/improvement/gp/botorch.py
imports: from __future__ import annotations
  from typing import Optional
  import numpy
  from packaging import version
  from optuna._imports import try_import
  from optuna.distributions import _is_distribution_log
  from optuna.distributions import CategoricalDistribution
  from optuna.distributions import FloatDistribution
  from optuna.distributions import IntDistribution
  from optuna.search_space import intersection_search_space
  from optuna.terminator.improvement.gp.base import BaseGaussianProcess
  from optuna.trial._frozen import FrozenTrial
  from optuna.trial._state import TrialState
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_trials_to_tensors(trials) and returns: torch,  torch