Skip to content

Commit f216d3f

Browse files
committed
feat(): started to work on add_.t evaluator, doesn't work yet
Signed-off-by: Abhiram Iyer <[email protected]> Signed-off-by: Abhiram Iyer <[email protected]>
1 parent f594e43 commit f216d3f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Diff for: core/conversion/evaluators/aten.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "core/conversion/evaluators/evaluators.h"
1111
#include "core/conversion/evaluators/eval_macros.h"
1212

13+
// #include <csignal>
14+
1315
namespace trtorch {
1416
namespace core {
1517
namespace 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> {

0 commit comments

Comments
 (0)