if (!sType1)
return success(!sType2);
- if (sType1.getRank() == -1 || sType2.getRank() == -1)
+ if (!sType1.hasRank() || !sType2.hasRank())
return success();
return success(sType1.getShape() == sType2.getShape());
///
/// shaped-type ::= vector-type | tensor-type
///
-/// This method also checks the type has static shape and ranked.
+/// This method also checks the type has static shape.
ShapedType Parser::parseShapedType() {
auto elementType = parseType();
if (!elementType)
if (parseToken(Token::comma, "expected ','"))
return nullptr;
- if (!type.hasStaticShape() || type.getRank() == -1) {
- return (emitError("shaped literal must be ranked and have static shape"),
- nullptr);
+ if (!type.hasStaticShape()) {
+ return (emitError("shaped literal must have static shape"), nullptr);
}
return type;
}
func @elementsattr_non_ranked() -> () {
^bb0:
- "foo"(){bar: dense<tensor<?xi32>, [4]>} : () -> () // expected-error {{shaped literal must be ranked and have static shape}}
+ "foo"(){bar: dense<tensor<?xi32>, [4]>} : () -> () // expected-error {{shaped literal must have static shape}}
}
// -----