File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
core/conversion/evaluators Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1010#include " core/conversion/evaluators/evaluators.h"
1111#include " core/conversion/evaluators/eval_macros.h"
1212
13+ // #include <csignal>
14+
1315namespace trtorch {
1416namespace core {
1517namespace conversion {
@@ -243,6 +245,28 @@ auto aten_registrations TRTORCH_UNUSED = RegisterNodeEvaluators()
243245 " aten::add.int(int a, int b) -> (int)" ,
244246 " aten::add.float(float a, float b) -> (float)"
245247 })
248+ }).evaluator({
249+ c10::Symbol::fromQualString (" aten::add_" ),
250+ [](const torch::jit::Node* n, kwargs& args) -> c10::optional<torch::jit::IValue> {
251+ LOG_DEBUG (" aten::add_ evaluator is found" );
252+
253+ // std::raise(SIGINT);
254+
255+ if (args.at (n->input (0 )).IValue ()->isList ()) {
256+ auto a = args.at (n->input (0 )).IValue ()->to <c10::List<c10::IValue>>();
257+ auto b = args.at (n->input (1 )).IValue ()->to <c10::List<c10::IValue>>();
258+
259+ // incorrect syntax
260+ // for (auto each : b) {
261+ // a.push_back(each);
262+ // }
263+
264+ return a;
265+ }
266+ },
267+ EvalOptions ().validSchemas ({
268+ " aten::add_.t(t[](a!) self, t[] b) -> (t[])"
269+ })
246270 }).evaluator({
247271 c10::Symbol::fromQualString (" aten::mul" ),
248272 [](const torch::jit::Node* n, kwargs& args) -> c10::optional<torch::jit::IValue> {
You can’t perform that action at this time.
0 commit comments