code: def _scale_input(
      input: Tensor,
      baseline: Union[Tensor, int, float],
      rand_coefficient: Tensor,
  ) -> Tensor:
      # batch size
      bsz = input.shape[0]
      inp_shape_wo_bsz = input.shape[1:]
      inp_shape = (bsz,) + tuple([1] * len(inp_shape_wo_bsz))
  
      # expand and reshape the indices
      rand_coefficient = rand_coefficient.view(inp_shape)
  
      input_baseline_scaled = (
          rand_coefficient * input + (1.0 - rand_coefficient) * baseline
      ).requires_grad_()
      return input_baseline_scaled
  
imports: import typing
  from typing import Any, Callable, Tuple, Union
  import numpy
  import torch
  from captum._utils.common import _is_tuple
  from captum._utils.typing import BaselineType, Literal, TargetType, Tensor, TensorOrTupleOfTensorsGeneric
  from captum.attr._core.noise_tunnel import NoiseTunnel
  from captum.attr._utils.attribution import GradientAttribution
  from captum.attr._utils.common import _compute_conv_delta_and_format_attrs, _format_callable_baseline, _format_input_baseline
  from captum.log import log_usage
label_desc: Use image node_id 1 for calling a global function with example usage: _scale_input(input, baseline, rand_coefficient) and returns: input_baseline_scaled