Use byte tensor for mnist labels. (#13363)

Summary:
The C++ mnist example https://github.com/goldsborough/examples/blob/cpp/cpp/mnist/mnist.cpp
 does not work because the labels are not correctly loaded.  Currently it achieves 100 % accuracy.  Specifying byte dtype fixes the issue.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13363

Differential Revision: D12860258

Pulled By: goldsborough

fbshipit-source-id: ad7b9256e4fc627240e25c79de9d47b31da18d38
diff --git a/torch/csrc/api/src/data/datasets/mnist.cpp b/torch/csrc/api/src/data/datasets/mnist.cpp
index ba4a437..911e5c3 100644
--- a/torch/csrc/api/src/data/datasets/mnist.cpp
+++ b/torch/csrc/api/src/data/datasets/mnist.cpp
@@ -90,7 +90,7 @@
   expect_int32(targets, kTargetMagicNumber);
   expect_int32(targets, count);
 
-  auto tensor = torch::empty(count);
+  auto tensor = torch::empty(count, torch::kByte);
   targets.read(reinterpret_cast<char*>(tensor.data_ptr()), count);
   return tensor.to(torch::kInt64);
 }