mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 09:31:59 +08:00
[mlir][sparse] introduce operations to query sparse tensor slice offset/strides at the given dimenion
Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D141442
This commit is contained in:
@@ -765,6 +765,20 @@ LogicalResult ToValuesOp::verify() {
|
||||
return success();
|
||||
}
|
||||
|
||||
LogicalResult ToSliceOffsetOp::verify() {
|
||||
auto rank = getRankedTensorType(getSlice()).getRank();
|
||||
if (rank <= getDim().getSExtValue() || getDim().getSExtValue() < 0)
|
||||
return emitError("requested dimension out of bound");
|
||||
return success();
|
||||
}
|
||||
|
||||
LogicalResult ToSliceStrideOp::verify() {
|
||||
auto rank = getRankedTensorType(getSlice()).getRank();
|
||||
if (rank <= getDim().getSExtValue() || getDim().getSExtValue() < 0)
|
||||
return emitError("requested dimension out of bound");
|
||||
return success();
|
||||
}
|
||||
|
||||
LogicalResult GetStorageSpecifierOp::verify() {
|
||||
RETURN_FAILURE_IF_FAILED(verifySparsifierGetterSetter(
|
||||
getSpecifierKind(), getDim(), getSpecifier(), getOperation()))
|
||||
|
||||
Reference in New Issue
Block a user