code: def div(a: Tensor, b: Tensor) -> Tensor:
      _0, _1 = get_constants_like(values=(0, 1), ref=a)
      case = ((a == _0) & (b == _0)) | (a.isinf() & a.isinf())
      return torch.where(
          case,
          torch.where(a != b, -_1, _1),
          a / torch.where(case, _1, b),
      )
  
imports: from __future__ import annotations
  import math
  from typing import Callable, Tuple, Union
  import torch
  from botorch.exceptions import UnsupportedError
  from botorch.utils.constants import get_constants_like
  from torch import finfo, Tensor
  from torch.nn.functional import softplus
label_desc: Use image node_id 5 for calling a global function with example usage: div(a, b) and returns: torch