Open
Description
At the moment, RankedTensorType has the following verification logic (link):
LogicalResult
RankedTensorType::verify(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<int64_t> shape, Type elementType,
Attribute encoding) {
for (int64_t s : shape)
if (s < 0 && !ShapedType::isDynamic(s))
return emitError() << "invalid tensor dimension size";
if (auto v = encoding.dyn_cast_or_null<VerifiableTensorEncoding>())
if (failed(v.verifyEncoding(shape, elementType, emitError)))
return failure();
return checkTensorElementType(emitError, elementType);
}
It would be good to apply a similar level of validation to shape operands (like DynamicReshapeOp:: output_shape). If these operands are partially or fully constant, we could check that their elements are non-negative.
Metadata
Metadata
Assignees
Type
Projects
Status
No status