mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
Revert "turn on -Werror=unused-function in our Bazel CPU build"
This reverts commit 67d313a032.
Reverted https://github.com/pytorch/pytorch/pull/79154 on behalf of https://github.com/malfet due to Breaks bazel build: https://hud.pytorch.org/pytorch/pytorch/commit/67d313a03259be4da7a1d623a9df6791e02248e8
This commit is contained in:
@@ -34,30 +34,29 @@ void testEvalModeForLoadedModule() {
|
||||
AT_ASSERT(module.attr("dropout").toModule().is_training());
|
||||
}
|
||||
|
||||
// TODO: this test never ran before and is broken.
|
||||
// void testSerializationInterop() {
|
||||
// if (isSandcastle()) {
|
||||
// // The module file to load is not generated in Sandcastle
|
||||
// return;
|
||||
// }
|
||||
void testSerializationInterop() {
|
||||
if (isSandcastle()) {
|
||||
// The module file to load is not generated in Sandcastle
|
||||
return;
|
||||
}
|
||||
|
||||
// // This should be generated by `test/cpp/jit/tests_setup.py`
|
||||
// std::ifstream input_stream("ivalue.pt");
|
||||
// std::vector<char> input;
|
||||
// input.insert(
|
||||
// input.begin(),
|
||||
// std::istream_iterator<char>(input_stream),
|
||||
// std::istream_iterator<char>());
|
||||
// IValue ivalue = pickle_load(input);
|
||||
// This should be generated by `test/cpp/jit/tests_setup.py`
|
||||
std::ifstream input_stream("ivalue.pt");
|
||||
std::vector<char> input;
|
||||
input.insert(
|
||||
input.begin(),
|
||||
std::istream_iterator<char>(input_stream),
|
||||
std::istream_iterator<char>());
|
||||
IValue ivalue = pickle_load(input);
|
||||
|
||||
// auto elements = ivalue.toTupleRef().elements();
|
||||
// auto ones = torch::ones({2, 2});
|
||||
// AT_ASSERT(ones.equal(elements.at(0).toTensor()));
|
||||
auto elements = ivalue.toTupleRef().elements();
|
||||
auto ones = torch::ones({2, 2});
|
||||
AT_ASSERT(ones.equal(elements.at(0).toTensor()));
|
||||
|
||||
// // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||
// auto twos = torch::ones({3, 5}) * 2;
|
||||
// AT_ASSERT(twos.equal(elements.at(1).toTensor()));
|
||||
// }
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||
auto twos = torch::ones({3, 5}) * 2;
|
||||
AT_ASSERT(twos.equal(elements.at(1).toTensor()));
|
||||
}
|
||||
|
||||
void testTorchSaveError() {
|
||||
if (isSandcastle()) {
|
||||
|
||||
Reference in New Issue
Block a user