Skip to content

Commit

Permalink
disable c10::SymIntNode tests on mobile (pytorch#84066)
Browse files Browse the repository at this point in the history
This fixes c++ tests' breaks where we were passing pointers and expected `is_symbolic` to return `true`

Pull Request resolved: pytorch#84066
Approved by: https://github.com/albanD
  • Loading branch information
Krovatkin authored and pytorchmergebot committed Aug 25, 2022
1 parent 2f04ba2 commit 86e134d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion c10/test/core/SymInt_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <c10/core/SymIntNodeImpl.h>

using namespace c10;

#ifndef C10_MOBILE
void check(int64_t value) {
EXPECT_TRUE(SymInt::check_range(value));
const auto i = SymInt(value);
Expand All @@ -29,3 +29,4 @@ TEST(SymIntTest, AddNode) {
TEST(SymIntTest, CheckRange) {
EXPECT_FALSE(SymInt::check_range(INT64_MIN));
}
#endif
2 changes: 2 additions & 0 deletions test/cpp/jit/test_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,7 @@ TEST(TestSymInt, AddSymbolicInt) {
ASSERT_TRUE((a + b).expect_int() == 8);
}

#ifndef C10_MOBILE
TEST(TestSymInt, TestIntrusive) {
auto a = c10::make_intrusive<c10::SymIntNodeImpl>();
auto b = c10::make_intrusive<c10::SymIntNodeImpl>();
Expand Down Expand Up @@ -1520,6 +1521,7 @@ TEST(TestSymInt, TestSymIntToSymIntNodeDispatch) {
}
}
}
#endif

TEST(FallbackGraphsTest, Basic) {
auto x = at::randn({1}, at::kCPU);
Expand Down
2 changes: 2 additions & 0 deletions test/cpp/lazy/test_lazy_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ static inline at::DeviceType DefaultDevice() {

} // namespace

#ifndef C10_MOBILE
TEST(LazyDynamicOpsTest, NarrowCopy) {
auto x = torch::rand({5, 10, 10}).to(kLazy);
const size_t Y_DIM = 3;
Expand All @@ -110,6 +111,7 @@ TEST(LazyDynamicOpsTest, NarrowCopyViaSymSizes) {
AllClose(z.cpu(), zc);
FLAGS_ltc_enable_symbolic_shapes = false;
}
#endif

TEST_F(LazyOpsTest, TestScalarTensor) {
torch::Tensor scalar_tensor = torch::scalar_tensor(
Expand Down

0 comments on commit 86e134d

Please sign in to comment.