Solved by markl in post #5 
              
              
                Based on the exception, I have updated the code to call .to(at::kLong) on the ground truth tensor. I now get different error (below). I think this means I need to look for a multi-target version of the nll function. 
#include <torch/script.h>
#include <torch/torch.h>
#include <iostream>

int main(in…