(tree)
| 17638 | throw new python.Error(`Unknown kind '${kind.__class__.__name__}'.`); |
| 17639 | } |
| 17640 | emitBinaryOp(tree) { |
| 17641 | const inputs = [tree.left, tree.right]; |
| 17642 | const kind = this.getNodeKind(tree.op, inputs.length); |
| 17643 | const overload = this.getOperatorOverload(tree.op, inputs.length); |
| 17644 | const named_values = this.getNamedValues(inputs, /*maybe_unpack=*/false); |
| 17645 | if (tree.op instanceof ast.In) { |
| 17646 | // std::iter_swap(named_values.begin() + 0, named_values.begin() + 1); |
| 17647 | throw new python.Error('Not implemented.'); |
| 17648 | } |
| 17649 | if (named_values[0].type() instanceof torch.TupleType && |
| 17650 | named_values[1].type() instanceof torch.TupleType && |
| 17651 | kind === 'aten::add') { |
| 17652 | const first_tuple = torch._C.createTupleUnpack(named_values[0].value(this.graph)).vec(); |
| 17653 | const second_tuple = torch._C.createTupleUnpack(named_values[1].value(this.graph)).vec(); |
| 17654 | first_tuple.insert(first_tuple.end(), second_tuple.begin(), second_tuple.end()); |
| 17655 | return this.graph.insertNode(this.graph.createTuple(first_tuple)).output(); |
| 17656 | } |
| 17657 | return torch._C.asSimple(torch._C.makeMagic(overload, new torch._C.BuiltinFunction(kind, null)).call(tree.range(), this.method, named_values, [], 0)); |
| 17658 | } |
| 17659 | emitDictLiteral(dl, type_hint) { |
| 17660 | const key_trees = dl.keys; |
| 17661 | const value_trees = dl.values; |
no test coverage detected