File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
include/mlir/Dialect/Shape/IR Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -226,12 +226,14 @@ def Shape_ReduceOp : Shape_Op<"reduce", []> {
226
226
}
227
227
228
228
def Shape_ShapeOfOp : Shape_Op<"shape_of",
229
- [DeclareOpInterfaceMethods<InferTypeOpInterface>]> {
229
+ [NoSideEffect, DeclareOpInterfaceMethods<InferTypeOpInterface>]> {
230
230
let summary = "Returns shape of a value or shaped type operand";
231
231
232
232
let arguments = (ins AnyTypeOf<[AnyShaped, Shape_ValueShapeType]>:$arg);
233
233
let results = (outs Shape_ShapeType:$result);
234
234
235
+ let assemblyFormat = "attr-dict $arg `:` type($arg)";
236
+
235
237
let hasFolder = 1;
236
238
}
237
239
Original file line number Diff line number Diff line change @@ -62,3 +62,8 @@ func @test_parse_const_shape() {
62
62
%1 = shape.const_shape [1 , 2 , 3 ]
63
63
return
64
64
}
65
+
66
+ func @test_shape_of (%arg0: tensor <?xf32 >) -> !shape.shape {
67
+ %0 = shape.shape_of %arg0 : tensor <?xf32 >
68
+ return %0 : !shape.shape
69
+ }
You can’t perform that action at this time.
0 commit comments