def create_iterable_dataset(torch_transforms_module, pipeline_results):
    """
    Create a PyTorch iterable dataset that loads samples from pipeline results.

    :param torch_transforms_module: The imported torch.transforms module.
    :param pipeline_results: Pipeline results iterator.
    :return: Dataset that has valid PyTorch images saved as tensors and density maps.
    """
    class PipelineDataset:
        def __init__(self):
            self.images_and_density_maps = pipeline_results
            self.image_transform = torch_transforms_module.Compose([
                torch_transforms_module.ToTensor()
            ])

        def __iter__(self):
            for image, density_map in self.images_and_density_maps:
                yield self.image_transform(image.copy().astype("float32")), density_map.copy().astype("float32")

    return PipelineDataset()