after assigning the squeeze labels to labels, printing labels gives:

tensor([1, 1, 1, 3])

However, the error from the loss is still the same:

RuntimeError: Assertion `cur_target >= 0 && cur_target < n_classes’ failed. at /Users/administrator/nightlies/pytorch-1.0.0/wheel_build_dirs/conda_3.7/conda/conda-bld/pytorch_1544144746443/work/aten/src/THNN/generic/ClassNLLCriterion.c:93