code: def _validate_model(model: Model, proximal_weights: Tensor) -> None:
      r"""Validate model
  
      Perform vaidation checks on model used in base acquisition function to make sure
      it is compatible with proximal weighting.
  
      Args:
          model: Model associated with base acquisition function to be validated.
          proximal_weights: A `d` dim tensor used to bias locality
                  along each axis.
      """
  
      # check model for train_inputs and single batch
      if not hasattr(model, "train_inputs"):
          raise UnsupportedError(
              "Acquisition function model must have `train_inputs`."
          )
  
      # get train inputs for each type of possible model
      if isinstance(model, ModelListGP):
          # ModelListGP models
          # check to make sure that the training inputs and input transformers for each
          # model match and are reversible
          train_inputs = model.train_inputs[0][0]
          input_transform = _get_input_transform(model.models[0])
  
          for i in range(len(model.train_inputs)):
              if not torch.equal(
                  train_inputs, model.train_inputs[i][0]
              ):
                  raise UnsupportedError(
                      "Proximal acquisition function does not support unequal "
                      "training inputs"
                  )
  
              if not input_transform == _get_input_transform(
                  model.models[i]
              ):
                  raise UnsupportedError(
                      "Proximal acquisition function does not support non-identical "
                      "input transforms"
                  )
  
      else:
          # any non-ModelListGP model
          train_inputs = model.train_inputs[0]
  
      # check to make sure that the model is single t-batch (q-batches are allowed)
      if (
          model.batch_shape != torch.Size([])
          and train_inputs.shape[1] != 1
      ):
          raise UnsupportedError(
              "Proximal acquisition function requires a single batch model"
          )
  
      # check to make sure that weights match the training data shape
      if (
          len(proximal_weights.shape) != 1
          or proximal_weights.shape[0] != train_inputs.shape[-1]
      ):
          raise ValueError(
              "`proximal_weights` must be a one dimensional tensor with "
              "same feature dimension as model."
          )
  
file_path: botorch/botorch/acquisition/proximal.py
imports: from __future__ import annotations
  from typing import Optional
  import torch
  from botorch.acquisition import AcquisitionFunction
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models import ModelListGP
  from botorch.models.gpytorch import BatchedMultiOutputGPyTorchModel
  from botorch.models.model import Model
  from botorch.models.transforms.input import InputTransform
  from botorch.utils import t_batch_mode_transform
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_model(model, proximal_weights) without return types