🐛 Describe the bug
Running this code throws an exception in bazel build
#include <torch/torch.h>
using namespace torch::nn;
int main() {
Linear x(128, 64);
x->to(torch::kInt32);
return 0;
}
C++ exception with description "data set to a tensor that requires gradients must be floating point or complex dtype
This is tested in CMake build by this test:
|
module->to(torch::kInt32); |
Versions
master 7d17e3b
cc @jbschlosser
🐛 Describe the bug
Running this code throws an exception in bazel build
This is tested in CMake build by this test:
pytorch/test/cpp/api/module.cpp
Line 346 in 228e082
Versions
master 7d17e3b
cc @jbschlosser