code: def test_get_bounds_as_ndarray(self):
      params = {
          "a": torch.rand(1),
          "b": torch.rand(1),
          "c": torch.rand(2),
      }
      bounds = {"a": (None, 1), "c": (0, None)}
  
      test = np.full((4, 2), (-float("inf"), float("inf")))
      test[0, 1] = 1
      test[2, 0] = 0
      test[3, 0] = 0
  
      array = get_bounds_as_ndarray(parameters=params, bounds=bounds)
      self.assertTrue(np.array_equal(test, array))
  
      # Test with tensor bounds.
      bounds = {
          "a": (None, torch.tensor(1, device=self.device)),
          "c": (torch.tensor(0, device=self.device), None),
      }
      array = get_bounds_as_ndarray(parameters=params, bounds=bounds)
      self.assertTrue(np.array_equal(test, array))
  
      # Test with n-dim tensor bounds.
      bounds = {
          "a": (None, torch.tensor(1, device=self.device)),
          "c": (
              torch.tensor([0, 0], device=self.device),
              torch.tensor([1, 1], device=self.device),
          ),
      }
      test[2:, 1] = 1
      array = get_bounds_as_ndarray(parameters=params, bounds=bounds)
      self.assertTrue(np.array_equal(test, array))
  
file_path: botorch/test/optim/utils/test_numpy_utils.py
imports: from __future__ import annotations
  from unittest.mock import MagicMock
  import numpy
  import torch
  from botorch.optim.closures.core import as_ndarray, get_tensors_as_ndarray_1d, set_tensors_from_ndarray_1d
  from botorch.optim.utils import get_bounds_as_ndarray
  from botorch.optim.utils.numpy_utils import torch_to_numpy_dtype_dict
  from botorch.utils.testing import BotorchTestCase
  from torch.nn import Parameter
label_desc: Use image node_id 6 for calling the TestNumpyUtils obj's underlying member method code with example usage: obj.test_get_bounds_as_ndarray() without return types