mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Use AT_INTERNAL_ASSERT in test_base (#20555)
Summary: as title. We were using AT_ASSERT, which is newly deprecated. In this case, we do in fact want an internal assertion since this is used in testing code to describe expected behavior. Pull Request resolved: https://github.com/pytorch/pytorch/pull/20555 Differential Revision: D15362964 Pulled By: suo fbshipit-source-id: 984bfe71a774571611f3bbd81767d3cdb878a6fd
This commit is contained in:
committed by
Facebook Github Bot
parent
4a85e7955c
commit
70eb315da4
@ -296,16 +296,16 @@ inline void deprecated_AT_CHECK() {}
|
|||||||
/*
|
/*
|
||||||
// Deprecation disabled until we fix sites in our codebase
|
// Deprecation disabled until we fix sites in our codebase
|
||||||
C10_DEPRECATED_MESSAGE("AT_ASSERT is deprecated, if you mean to indicate an internal invariant failure, use " \
|
C10_DEPRECATED_MESSAGE("AT_ASSERT is deprecated, if you mean to indicate an internal invariant failure, use " \
|
||||||
"AT_INTERNAL_ASSERT instead; if you mean to do user error checking, use " \
|
"TORCH_INTERNAL_ASSERT instead; if you mean to do user error checking, use " \
|
||||||
"AT_CHECK. See https://github.com/pytorch/pytorch/issues/20287 for more details.")
|
"TORCH_CHECK. See https://github.com/pytorch/pytorch/issues/20287 for more details.")
|
||||||
*/
|
*/
|
||||||
inline void deprecated_AT_ASSERT() {}
|
inline void deprecated_AT_ASSERT() {}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Deprecation disabled until we fix sites in our codebase
|
// Deprecation disabled until we fix sites in our codebase
|
||||||
C10_DEPRECATED_MESSAGE("AT_ASSERTM is deprecated, if you mean to indicate an internal invariant failure, use " \
|
C10_DEPRECATED_MESSAGE("AT_ASSERTM is deprecated, if you mean to indicate an internal invariant failure, use " \
|
||||||
"AT_INTERNAL_ASSERT instead; if you mean to do user error checking, use " \
|
"TORCH_INTERNAL_ASSERT instead; if you mean to do user error checking, use " \
|
||||||
"AT_CHECK. See https://github.com/pytorch/pytorch/issues/20287 for more details.")
|
"TORCH_CHECK. See https://github.com/pytorch/pytorch/issues/20287 for more details.")
|
||||||
*/
|
*/
|
||||||
inline void deprecated_AT_ASSERTM() {}
|
inline void deprecated_AT_ASSERTM() {}
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
#include <test/cpp/common/support.h>
|
#include <test/cpp/common/support.h>
|
||||||
#else
|
#else
|
||||||
#include "c10/util/Exception.h"
|
#include "c10/util/Exception.h"
|
||||||
#define ASSERT_EQ(x, y) AT_ASSERT((x) == (y))
|
#define ASSERT_EQ(x, y) TORCH_INTERNAL_ASSERT((x) == (y))
|
||||||
#define ASSERT_NE(x, y) AT_ASSERT((x) != (y))
|
#define ASSERT_NE(x, y) TORCH_INTERNAL_ASSERT((x) != (y))
|
||||||
#define ASSERT_TRUE AT_ASSERT
|
#define ASSERT_TRUE TORCH_INTERNAL_ASSERT
|
||||||
#define ASSERT_FALSE(x) ASSERT_TRUE(!(x))
|
#define ASSERT_FALSE(x) ASSERT_TRUE(!(x))
|
||||||
#define ASSERT_THROWS_WITH(statement, substring) \
|
#define ASSERT_THROWS_WITH(statement, substring) \
|
||||||
try { \
|
try { \
|
||||||
|
Reference in New Issue
Block a user