code: def _validate_scalarize_inputs(weights: Tensor, m: int) -> None:
      if weights.ndim > 1:
          raise BotorchTensorDimensionError(
              "`weights` must be one-dimensional"
          )
      if m != weights.size(0):
          raise RuntimeError(
              f"Output shape not equal to that of weights. Output shape is {m} and "
              f"weights are {weights.shape}"
          )
  
imports: from __future__ import annotations
  import warnings
  from contextlib import ExitStack
  from typing import Optional, Tuple, TYPE_CHECKING, Union
  import torch
  from botorch.exceptions.errors import BotorchTensorDimensionError
  from botorch.posteriors.base_samples import _reshape_base_samples_non_interleaved
  from botorch.posteriors.torch import TorchPosterior
  from gpytorch.distributions import MultitaskMultivariateNormal, MultivariateNormal
  from linear_operator import settings
  from linear_operator.operators import BlockDiagLinearOperator, DenseLinearOperator, LinearOperator, SumLinearOperator
  from torch import Tensor
  from torch.distributions import Normal
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_scalarize_inputs(weights, m) without return types