code: def log_ndtr(x: Tensor) -> Tensor:
      """Implementation of log_ndtr that remedies problems of torch.special's version
      for large negative x, where the torch implementation yields Inf or NaN gradients.
  
      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(ndtr(x)).
      """
      if not (x.dtype == torch.float32 or x.dtype == torch.float64):
          raise TypeError(
              f"log_Phi only supports torch.float32 and torch.float64 "
              f"dtypes, but received {x.dtype = }."
          )
      neg_inv_sqrt_2, log_2 = get_constants_like(
          (_neg_inv_sqrt_2, _log_2), x
      )
      return log_erfc(neg_inv_sqrt_2 * x) - log_2
  
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 10 for calling a global function with example usage: log_ndtr(x) and returns: unknown