def __call__()

in src/chug/hfds/collate.py [0:0]


    def __call__(self, batch):
        item = False
        if not self.apply_collate and isinstance(batch, dict):
            batch = [batch]
            item = True

        if self._debug:
            for b in batch:
                for k, v in b.items():
                    print(k, type(v))
                    if isinstance(v, torch.Tensor):
                        print(v.shape)

        if self.pipeline:
            for pipe_fn in self.pipeline:
                batch = invoke(pipe_fn, batch)

        batch = list(batch)

        if self._debug:
            for b in batch:
                for k, v in b.items():
                    print(k, v)

        if self.apply_collate:
            return self.collate_fn(batch)
        else:
            return batch[0] if item else batch