code: def log_erfc(x: Tensor) -> Tensor:
      """Computes the logarithm of the complementary error function in a numerically
      stable manner. The GitHub issue https://github.com/pytorch/pytorch/issues/31945
      tracks progress toward moving this feature into PyTorch in C++.
  
      Args:
          x: An input tensor with dtype torch.float32 or torch.float64.
  
      Returns:
          A tensor of values of the same type and shape as x containing log(erfc(x)).
      """
      if not (x.dtype == torch.float32 or x.dtype == torch.float64):
          raise TypeError(
              f"log_erfc only supports torch.float32 and torch.float64 "
              f"dtypes, but received {x.dtype = }."
          )
      is_pos = x > 0
      x_pos = x.masked_fill(~is_pos, 0)
      x_neg = x.masked_fill(is_pos, 0)
      return torch.where(
          is_pos,
          torch.log(torch.special.erfcx(x_pos)) - x_pos.square(),
          torch.log(torch.special.erfc(x_neg)),
      )
  
imports: from __future__ import annotations
  import math
  from functools import lru_cache
  from math import pi
  from numbers import Number
  from typing import Any, Callable, Iterable, Iterator, Optional, Tuple, Union
  import torch
  from botorch.utils.safe_math import logdiffexp
  from numpy.polynomial.legendre import leggauss
  from torch import BoolTensor, LongTensor, Tensor
label_desc: Use image node_id 11 for calling a global function with example usage: log_erfc(x) and returns: torch