Thank you for the help, i removed half() and it seems to be working
    sample_dataset = VOCDataset( csv_file_path , img_dir , label_path, transform=transform)

    sample_loader = DataLoader(
        dataset=sample_dataset,
        batch_size=2,
        num_workers=2,
        pin_memory=True,
        shuffle=True,
        drop_last=True,
    )

    device = 'cuda'if torch.cuda.is_available() else 'cpu'

    model = Yolov1(split_size=7, num_boxes=2, num_classes=20).to(device)

    optimizer = optim.Adam( model.parameters() , lr=learning_rate , weight_decay=weight_decay)

    loss_func = YoloLoss()

    scaler = torch.cuda.amp.GradScaler()

    for _ in  range(2):

        print('iter : ',_,'\n')

        x , y = next( iter(sample_loader) )

        with torch.cuda.amp.autocast():

            x , y = Variable(x).to(device) , Variable(y).to(device)

            optimizer.zero_grad()

            out = model(x)

        print('out : ',out , '\n')

        loss = loss_func(out,y)

        scaler.scale(loss).backward()
        scaler.step(optimizer)
        scaler.update()

        print( 'loss : ',loss , '\n')
        print( 'loss : data ', loss.data , '\n')
        print(' loss : grad ',loss.grad , '\n')