mirror of https://github.com/llvm/torch-mlir
Add ellipsis constants.
parent
f3829b1d4f
commit
a1e6ff4ab7
|
@ -61,3 +61,10 @@ def joined_string_constant():
|
||||||
a = "I am" " still here"
|
a = "I am" " still here"
|
||||||
return a
|
return a
|
||||||
|
|
||||||
|
# CHECK-LABEL: func @ellipsis
|
||||||
|
@import_global
|
||||||
|
def ellipsis():
|
||||||
|
# CHECK: %[[A:.*]] = basicpy.singleton : !basicpy.EllipsisType
|
||||||
|
# CHECK: basicpy.unknown_cast %[[A]]
|
||||||
|
a = ...
|
||||||
|
return a
|
||||||
|
|
|
@ -210,6 +210,8 @@ class ExpressionImporter(BaseNodeVisitor):
|
||||||
self.fctx.abort("unknown named constant '%r'" % (ast_node.value,))
|
self.fctx.abort("unknown named constant '%r'" % (ast_node.value,))
|
||||||
elif isinstance(ast_node, ast.Str):
|
elif isinstance(ast_node, ast.Str):
|
||||||
self.value = ir_h.basicpy_str_constant_op(ast_node.s).result
|
self.value = ir_h.basicpy_str_constant_op(ast_node.s).result
|
||||||
|
elif isinstance(ast_node, ast.Ellipsis):
|
||||||
|
self.value = ir_h.basicpy_singleton_op(ir_h.basicpy_EllipsisType).result
|
||||||
else:
|
else:
|
||||||
self.fctx.abort("unknown constant type %s" %
|
self.fctx.abort("unknown constant type %s" %
|
||||||
(ast_node.__class__.__name__))
|
(ast_node.__class__.__name__))
|
||||||
|
|
Loading…
Reference in New Issue