I guess this error might be raised, if the batch size was set to 1 and batch.action might then be a single scalar value / integer? If so, you could most likely use torch.tensor(batch.action) instead of torch.cat.