class_docstr: An abstract class representing a Dataset.
  
  All other datasets should subclass it. All subclasses should override
  ``__len__``, that provides the size of the dataset, and ``__getitem__``,
  supporting integer indexing in range from 0 to len(self) exclusive.
class_docstr_tok: ["An","abstract","class","representing","a","Dataset",".","All","other","datasets","should","subclass","it",".","All","subclasses","should","override","``","__len__","``",",","that","provides","the","size","of","the","dataset",",","and","``","__getitem__","``",",","supporting","integer","indexing","in","range","from","0","to","len","(","self",")","exclusive","."]
docstr: Make a single pass through the entire dataset in order to fit
  any parameters of the transforms which require the entire dataset.
  e.g. StandardScaler() requires mean and std for the entire dataset.
  
  If you dont call this fit function, then transforms which require properties
  of the entire dataset will just work at the batch level.
  e.g. StandardScaler() will normalize each batch by the specific batch mean/std
docstr_tok: ["Make","a","single","pass","through","the","entire","dataset","in","order","to","fit","any","parameters","of","the","transforms","which","require","the","entire","dataset",".","e.g",".","StandardScaler","(",")","requires","mean","and","std","for","the","entire","dataset",".","If","you","dont","call","this","fit","function",",","then","transforms","which","require","properties","of","the","entire","dataset","will","just","work","at","the","batch","level",".","e.g",".","StandardScaler","(",")","will","normalize","each","batch","by","the","specific","batch","mean\/std"]
code: def fit_transforms(self):
      """
      Make a single pass through the entire dataset in order to fit
      any parameters of the transforms which require the entire dataset.
      e.g. StandardScaler() requires mean and std for the entire dataset.
  
      If you dont call this fit function, then transforms which require properties
      of the entire dataset will just work at the batch level.
      e.g. StandardScaler() will normalize each batch by the specific batch mean/std
      """
      it_fit = hasattr(self.input_transform, "update_fit")
      tt_fit = hasattr(self.target_transform, "update_fit")
      ct_fit = hasattr(self.co_transform, "update_fit")
      if it_fit or tt_fit or ct_fit:
          for sample_idx in range(len(self)):
              if hasattr(self, "input_loader"):
                  x = self.input_loader(self.inputs[sample_idx])
              else:
                  x = self.inputs[sample_idx]
              if it_fit:
                  self.input_transform.update_fit(x)
              if self.has_target:
                  if hasattr(self, "target_loader"):
                      y = self.target_loader(self.targets[sample_idx])
                  else:
                      y = self.targets[sample_idx]
              if tt_fit:
                  self.target_transform.update_fit(y)
              if ct_fit:
                  self.co_transform.update_fit(x, y)
  
file_path: pywick/pywick/datasets/BaseDataset.py
imports: import numpy
  import torch
  from torchvision import transforms
  from .data_utils import is_tuple_or_list
label_desc: Use image node_id 6 for calling the BaseDataset obj's underlying member method code with example usage: obj.fit_transforms() without return types