mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Test Plan: revert-hammer
Differential Revision:
D23802296 (d2b045030e)
Original commit changeset: 20c9798a414e
fbshipit-source-id: a28d56039ca404fe94ed7572f1febd1673e3e788
25 lines
623 B
C++
25 lines
623 B
C++
#include "test/cpp/jit/test_base.h"
|
|
#include "test/cpp/jit/test_utils.h"
|
|
|
|
#include "torch/csrc/jit/passes/create_autodiff_subgraphs.h"
|
|
|
|
namespace torch {
|
|
namespace jit {
|
|
|
|
void testCreateAutodiffSubgraphs() {
|
|
auto graph = build_lstm();
|
|
CreateAutodiffSubgraphs(graph, /*threshold=*/2);
|
|
// all of the ops are within the DifferentiableGraph
|
|
testing::FileCheck()
|
|
.check_not("aten::mm")
|
|
->check_not("aten::sigmoid")
|
|
->check_not("aten::tanh")
|
|
->check_not("aten::mul")
|
|
->check("DifferentiableGraph")
|
|
->check_next("return")
|
|
->run(*graph);
|
|
}
|
|
|
|
} // namespace jit
|
|
} // namespace torch
|