| 17835 | return `${prefix}${this._temp_name_count++}`; |
| 17836 | } |
| 17837 | handleMaybeNoReturn(def, block) { |
| 17838 | const decl_ret = this._def_stack[this._def_stack.length - 1]._declared_return_type; |
| 17839 | if (this.exit_blocks.size === 0) { |
| 17840 | if (decl_ret && decl_ret !== torch.NoneType.get()) { |
| 17841 | throw new python.Error('Function was not annotated as having type None, but does not return along all paths.'); |
| 17842 | } |
| 17843 | const b = new torch._C.WithInsertPoint(block.nodes().end()); |
| 17844 | // this.emitReturn(Return::create(def.range(), Expr(Compound::create(TK_NONE, def.range(), {})))); |
| 17845 | b.dispose(); |
| 17846 | throw new python.Error("'torch._C.to_ir.handleMaybeNoReturn' not implemented."); |
| 17847 | } else if (this._def_stack[this._def_stack.length - 1]._merged_return_type === null) { |
| 17848 | this._def_stack[this._def_stack.length - 1]._merged_return_type = decl_ret === null ? torch.NoneType.get() : decl_ret; |
| 17849 | } |
| 17850 | } |
| 17851 | getAdjTupleIndex(loc, tuple_type, input_index, allow_out_of_bounds) { |
| 17852 | let adj_index = input_index; |
| 17853 | const tuple_len = tuple_type.elements().length; |