class_docstr: NaN handling policy for observations.
  
  * ``ignore``: Do not check for NaN values (the default).
  * ``mask``: Mask out NaN values during calculation. If an output is NaN in a single batch element, this output
    is masked for the complete batch. This strategy likely is a good choice if you have NaN values.
  * ``fill``: Fill in NaN values with a dummy value, perform computations and filter them later.
    Not supported by :class:`gpytorch.mlls.ExactMarginalLogLikelihood`.
    Does not support lazy covariance matrices during prediction.
class_docstr_tok: ["NaN","handling","policy","for","observations",".","*","``","ignore","``",":","Do","not","check","for","NaN","values","(","the","default",")",".","*","``","mask","``",":","Mask","out","NaN","values","during","calculation",".","If","an","output","is","NaN","in","a","single","batch","element",",","this","output","is","masked","for","the","complete","batch",".","This","strategy","likely","is","a","good","choice","if","you","have","NaN","values",".","*","``","fill","``",":","Fill","in","NaN","values","with","a","dummy","value",",","perform","computations","and","filter","them","later",".","Not","supported","by",":","class",":","`","gpytorch.mlls.ExactMarginalLogLikelihood","`",".","Does","not","support","lazy","covariance","matrices","during","prediction","."]
docstr: Constructs a tensor that masks out all elements in the event shape of the tensor which contain a NaN value in
  any batch element. Applying this index flattens the event_shape, as the task structure cannot be retained.
  This function is used if observation_nan_policy is set to 'mask'.
  
  :param Tensor observations: The observations to search for NaN values in.
  :param torch.Size event_shape: The shape of a single event, i.e. the shape of observations without batch
      dimensions.
  :return: The mask to the event dimensions of the observations.
docstr_tok: ["Constructs","a","tensor","that","masks","out","all","elements","in","the","event","shape","of","the","tensor","which","contain","a","NaN","value","in","any","batch","element",".","Applying","this","index","flattens","the","event_shape",",","as","the","task","structure","can","not","be","retained",".","This","function","is","used","if","observation_nan_policy","is","set","to","'mask","'",".",":","param","Tensor","observations",":","The","observations","to","search","for","NaN","values","in",".",":","param","torch.Size","event_shape",":","The","shape","of","a","single","event",",","i.e",".","the","shape","of","observations","without","batch","dimensions",".",":","return",":","The","mask","to","the","event","dimensions","of","the","observations","."]
code: def _get_observed(observations, event_shape) -> Tensor:
      """
      Constructs a tensor that masks out all elements in the event shape of the tensor which contain a NaN value in
      any batch element. Applying this index flattens the event_shape, as the task structure cannot be retained.
      This function is used if observation_nan_policy is set to 'mask'.
  
      :param Tensor observations: The observations to search for NaN values in.
      :param torch.Size event_shape: The shape of a single event, i.e. the shape of observations without batch
          dimensions.
      :return: The mask to the event dimensions of the observations.
      """
      return ~torch.any(
          torch.isnan(observations.reshape(-1, *event_shape)), dim=0
      )
  
imports: import torch
  from linear_operator.settings import _linalg_dtype_cholesky, _linalg_dtype_symeig, cg_tolerance, cholesky_jitter, cholesky_max_tries, ciq_samples, deterministic_probes, fast_computations, linalg_dtypes, max_cg_iterations, max_cholesky_size, max_lanczos_quadrature_iterations, max_preconditioner_size, max_root_decomposition_size, min_preconditioning_size, minres_tolerance, num_contour_quadrature, num_trace_samples, preconditioner_tolerance, skip_logdet_forward, terminate_cg_by_size, tridiagonal_jitter, use_toeplitz, verbose_linalg
  from torch import Tensor
label_desc: Use image node_id 2 for calling the observation_nan_policy obj's underlying member method code with example usage: obj._get_observed(observations, event_shape) and returns: unknown