ok now i have remove .log() with target and add in the train model in loss part as you can see in the loss y.log(). but again this error is appearing

training
    model.train()
    for step, (x, y) in enumerate(tqdm(train_loader, desc='[TRAIN] Epoch '+str(epoch+1)+'/'+str(args.epochs))):
        if step >= args.steps:
            break
        x = x.to(device).float()
        #y = y.to(device, dtype=torch.int64)
        y = y.to(device).float()

        #y = y.squeeze(1)

        # dim = input.dim(y)

        optimizer.zero_grad()
        output = model(x)

        # loss
        l = criterion(output, y.log())
        tot_soft += l.item()
        l.backward()
        optimizer.step()