import d3rlpy
import torch
from denoising_diffusion_pytorch import Unet, GaussianDiffusion, Unet1D, GaussianDiffusion1D, Trainer1D, Dataset1D
import time

def generation(model, m, max):
    generate1_start = time.time()
    DiffSampledScaled = model.sample(batch_size=m)
    generate1_end = time.time()
    GenerateTimeUsage = generate1_end - generate1_start
    DiffSampled = -DiffSampledScaled * max

    return DiffSampled, GenerateTimeUsage