code: def get_constants_like(
      values: Union[Number, Iterator[Number]],
      ref: Tensor,
  ) -> Union[Tensor, Iterator[Tensor]]:
      return get_constants(values, device=ref.device, dtype=ref.dtype)
  
file_path: botorch/botorch/utils/constants.py
imports: from __future__ import annotations
  from functools import lru_cache
  from numbers import Number
  from typing import Iterator, Optional, Tuple, Union
  import torch
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: get_constants_like(values, ref) and returns: get_constants