2020-03-10 23:02:30 +00:00
|
|
|
#include <test/cpp/jit/test_base.h>
|
|
|
|
|
#include <test/cpp/jit/test_utils.h>
|
|
|
|
|
|
|
|
|
|
#include "torch/csrc/jit/runtime/custom_operator.h"
|
|
|
|
|
|
|
|
|
|
namespace torch {
|
|
|
|
|
namespace jit {
|
2020-03-12 03:57:02 +00:00
|
|
|
inline c10::AliasAnalysisKind aliasAnalysisFromSchema() {
|
|
|
|
|
return c10::AliasAnalysisKind::FROM_SCHEMA;
|
2020-03-10 23:02:30 +00:00
|
|
|
}
|
|
|
|
|
|
2020-04-02 21:50:24 +00:00
|
|
|
namespace {
|
2020-03-10 23:02:30 +00:00
|
|
|
RegisterOperators reg({
|
|
|
|
|
// This operator is intended to be used in JIT analysis and transformation
|
|
|
|
|
// pass unit tests in which Values with type Tensor are often required. It
|
|
|
|
|
// should not be used in situations in which the graph is actually executed
|
|
|
|
|
// because it always produces empty Tensors.
|
|
|
|
|
Operator(
|
|
|
|
|
"prim::MakeTestTensor() -> Tensor",
|
2020-06-30 02:22:42 +00:00
|
|
|
[](Stack* stack) { push(stack, at::Tensor()); },
|
2020-03-10 23:02:30 +00:00
|
|
|
aliasAnalysisFromSchema()),
|
|
|
|
|
});
|
2020-04-02 21:50:24 +00:00
|
|
|
}
|
2020-03-10 23:02:30 +00:00
|
|
|
|
|
|
|
|
} // namespace jit
|
|
|
|
|
} // namespace torch
|