class_docstr: This is a basic class which preprocesses the data.
  Basically, it takes messy data, detects potential nan, bad types end convert the
  data to a type handled by the VAE models (*i.e.* `torch.Tensor`). Moreover, if the
  data does not have the same shape, a reshaping is applied and data is resized to the
  **minimal shape**.
class_docstr_tok: ["This","is","a","basic","class","which","preprocesses","the","data",".","Basically",",","it","takes","messy","data",",","detects","potential","nan",",","bad","types","end","convert","the","data","to","a","type","handled","by","the","VAE","models","(","*","i.e",".","*","`","torch.Tensor","`",")",".","Moreover",",","if","the","data","does","not","have","the","same","shape",",","a","reshaping","is","applied","and","data","is","resized","to","the","*","*","minimal","shape","*","*","."]
docstr: Detects potential nan in input data
  
  Args:
      data (torch.Tensor): The data to be checked
  
  Return:
      (bool): True if data contains :obj:`nan`
docstr_tok: ["Detects","potential","nan","in","input","data","Args",":","data","(","torch.Tensor",")",":","The","data","to","be","checked","Return",":","(","bool",")",":","True","if","data","contains",":","obj",":","`","nan","`"]
code: def has_nan(data: torch.Tensor) -> bool:
      """Detects potential nan in input data
  
      Args:
          data (torch.Tensor): The data to be checked
  
      Return:
          (bool): True if data contains :obj:`nan`
      """
  
      if (data != data).sum() > 0:
          return True
      else:
          return False
  
file_path: benchmark_VAE/src/pythae/data/preprocessors.py
imports: import logging
  from typing import Optional, Union
  import numpy
  import torch
  from typing_extensions import Literal
  from pythae.data.datasets import BaseDataset
label_desc: Use image node_id 6 for calling the DataProcessor obj's underlying member method code with example usage: obj.has_nan(data) and returns: True, False