code: def _update_batches_if_needed(self)->None:
          "one_batch function is extremely slow with large datasets.  This is caching the result as an optimization."
          if self.learn.data.valid_dl is None: return # Running learning rate finder, so return
          update_batches = self.data is not self.learn.data
          if not update_batches: return
          self.data = self.learn.data
          self.trn_batch = self._get_new_batch(ds_type=DatasetType.Train)
          self.val_batch = self._get_new_batch(ds_type=DatasetType.Validf _update_batches_if_needed(self)->None:
          "one_batch function is extremely slow with large datasets.  This is caching the result as an optimization."
          if self.learn.data.valid_dl is None: return # Running learning rate finder, so return
          update_batches = self.data is not self.learn.data
          if not update_batches: return
          self.data = self.learn.data
          self.trn_batch = self._get_new_batch(ds_type=DatasetType.Train)
          self.val_batch = self._get_new_batch(ds_type=DatasetType.Valid)
docs: one_batch function is extremely slow with large datasets.  This is caching the result as an optimization.