(inp, odtype)
| 120 | |
| 121 | |
| 122 | def typecvt(inp, odtype): |
| 123 | odtype = np.dtype(odtype) if isinstance(odtype, str) else odtype |
| 124 | return HLOTensor( |
| 125 | hlo.ConvertOp( |
| 126 | ir_utils.make_ir_type_according_meta(inp.shape, odtype), inp.tensor |
| 127 | ).result |
| 128 | ) |
| 129 | |
| 130 | |
| 131 | def _compare(lhs, rhs, mode, comparison_type=None): |