File tree 1 file changed +24
-0
lines changed
core/conversion/evaluators
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 10
10
#include " core/conversion/evaluators/evaluators.h"
11
11
#include " core/conversion/evaluators/eval_macros.h"
12
12
13
+ // #include <csignal>
14
+
13
15
namespace trtorch {
14
16
namespace core {
15
17
namespace conversion {
@@ -243,6 +245,28 @@ auto aten_registrations TRTORCH_UNUSED = RegisterNodeEvaluators()
243
245
" aten::add.int(int a, int b) -> (int)" ,
244
246
" aten::add.float(float a, float b) -> (float)"
245
247
})
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
+ })
246
270
}).evaluator({
247
271
c10::Symbol::fromQualString (" aten::mul" ),
248
272
[](const torch::jit::Node* n, kwargs& args) -> c10::optional<torch::jit::IValue> {
You can’t perform that action at this time.
0 commit comments