(loc, v)
| 17180 | } |
| 17181 | } |
| 17182 | emitToBool(loc, v) { |
| 17183 | let out = null; |
| 17184 | const bool_cast = this.environment_stack.getSugaredVar('bool', loc); |
| 17185 | out = torch._C.asSimple(bool_cast.call(loc, this.method, [new torch._C.NamedValue(v)], [], 0)); |
| 17186 | if (!out) { |
| 17187 | throw new python.Error('Could not cast value to bool.'); |
| 17188 | } |
| 17189 | if (!out.type().isSubtypeOf(torch.BoolType.get())) { |
| 17190 | throw new python.Error('Expected a bool expression for condition.'); |
| 17191 | } |
| 17192 | return out; |
| 17193 | } |
| 17194 | emitUnaryOp(tree, magicMethod, opSymbol) { |
| 17195 | const inputs = [tree.operand]; |
| 17196 | const named_values = this.getNamedValues(inputs, /*maybe_unpack=*/false); |
no test coverage detected