Changeset View
Changeset View
Standalone View
Standalone View
mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Lines | with _ir.Context(): | ||||
_ir.IntegerAttr.get(_ir.IntegerType.get_signless(64), int(value))) | _ir.IntegerAttr.get(_ir.IntegerType.get_signless(64), int(value))) | ||||
else: | else: | ||||
raise ValueError(f"const requires int or float but got {type(value)}") | raise ValueError(f"const requires int or float but got {type(value)}") | ||||
def to_scalar_expression(self) -> ScalarExpression: | def to_scalar_expression(self) -> ScalarExpression: | ||||
return ScalarConst(self.value).expr() | return ScalarConst(self.value).expr() | ||||
def __repr__(self): | def __repr__(self): | ||||
return f"const({self.type_var}, {self.value})" | return f"const({self.value})" | ||||
class index(TensorExpression): | class index(TensorExpression): | ||||
"""Returns the iteration index for a given dimension name. | """Returns the iteration index for a given dimension name. | ||||
Resolves the given dimension name to obtain its position in the iteration | Resolves the given dimension name to obtain its position in the iteration | ||||
domain of the operation. | domain of the operation. | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 139 Lines • Show Last 20 Lines |