def one_batch(self, ds_type:DatasetType=DatasetType.Train, detach:bool=True, denorm:bool=True, cpu:bool=True)->Collection[Tensor]:
        "Get one batch from the data loader of `ds_type`. Optionally `detach` and `denorm`."
        dl = self.dl(ds_type)
        w = self.num_workers
        self.num_workers = 0
        try:     x,y = next(iter(dl))
        finally: self.num_workers = w
        if detach: x,y = to_detach(x,cpu=cpu),to_detach(y,cpu=cpu)
        norm = getattr(self,'norm',False)
        if denorm and norm:
            x = self.denorm(x)
            if norm.keywords.get('do_y',False): y = self.denorm(y, do_x=True)
        return x,y
def one_batch ( self , ds_type : DatasetType = DatasetType . Train , detach : bool = True , denorm : bool = True , cpu : bool = True ) -> Collection [ Tensor ] : dl = self . dl ( ds_type ) w = self . num_workers self . num_workers = 0 try : x , y = next ( iter ( dl ) ) finally : self . num_workers = w if detach : x , y = to_detach ( x , cpu = cpu ) , to_detach ( y , cpu = cpu ) norm = getattr ( self , 'norm' , False ) if denorm and norm : x = self . denorm ( x ) if norm . keywords . get ( 'do_y' , False ) : y = self . denorm ( y , do_x = True ) return x , y
Get one batch from the data loader of `ds_type`. Optionally `detach` and `denorm`.