MCPcopy
hub / github.com/apache/tvm / astype

Method astype

python/tvm/relax/expr.py:121–138  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 3

constFunction · 0.45
_my_moduleFunction · 0.45
copyfromMethod · 0.45

Calls

no outgoing calls

Tested by 1

_my_moduleFunction · 0.36