Cast the content type of the current data to dtype. Parameters ---------- dtype : str The target data type. Note ---- This function only works for TensorType Exprs. Returns ------- result : ExprWithOp
(self, dtype: str | DataType)
| 119 | """Basetype of all relax expressions that defines op overloading.""" |
| 120 | |
| 121 | def astype(self, dtype: str | DataType) -> "ExprWithOp": |
| 122 | """Cast the content type of the current data to dtype. |
| 123 | |
| 124 | Parameters |
| 125 | ---------- |
| 126 | dtype : str |
| 127 | The target data type. |
| 128 | |
| 129 | Note |
| 130 | ---- |
| 131 | This function only works for TensorType Exprs. |
| 132 | |
| 133 | Returns |
| 134 | ------- |
| 135 | result : ExprWithOp |
| 136 | The result expression. |
| 137 | """ |
| 138 | return _op_ffi_api.astype(self, dtype) # type: ignore |
| 139 | |
| 140 | def __neg__(self) -> "ExprWithOp": |
| 141 | return _op_ffi_api.negative(self) # type: ignore |
no outgoing calls