mirror of https://github.com/llvm/torch-mlir
[TOSA] Add aten.le.tensor support (#2033)
parent
318fe13468
commit
ad36e61040
|
@ -741,6 +741,10 @@ TOSA_PASS_SET = {
|
|||
"HardsigmoidRandomModule_basic",
|
||||
"HardswishModule_basic",
|
||||
"HardswishRandomModule_basic",
|
||||
"BucketizeTensorStaticFloatModule_basic",
|
||||
"BucketizeTensorStaticModule_basic",
|
||||
"ElementwiseLeFloatTensorModule_basic",
|
||||
"ElementwiseLeIntTensorModule_basic",
|
||||
"FullLikeModuleInt2DStatic_basic",
|
||||
"FullModuleInt3D_basic",
|
||||
"FullModuleFloat2D_basic",
|
||||
|
|
|
@ -3581,6 +3581,32 @@ LogicalResult ConvertAtenOp<AtenWhereSelfOp>::matchAndRewrite(
|
|||
return success();
|
||||
}
|
||||
|
||||
template <>
|
||||
LogicalResult ConvertAtenOp<AtenLeTensorOp>::matchAndRewrite(
|
||||
AtenLeTensorOp op, OpAdaptor adaptor,
|
||||
ConversionPatternRewriter &rewriter) const {
|
||||
|
||||
// Not a tensor type.
|
||||
auto selfType = adaptor.getSelf().getType().dyn_cast<TensorType>();
|
||||
if (!selfType)
|
||||
return rewriter.notifyMatchFailure(
|
||||
op, "Only tensor types input are currently supported");
|
||||
auto otherType = adaptor.getOther().getType().dyn_cast<TensorType>();
|
||||
if (!otherType)
|
||||
return rewriter.notifyMatchFailure(
|
||||
op, "Only tensor types condition are currently supported");
|
||||
|
||||
auto outType = getTypeConverter()->convertType(op.getType());
|
||||
|
||||
auto greaterOp = rewriter.create<tosa::GreaterOp>(
|
||||
op.getLoc(), outType, adaptor.getSelf(), adaptor.getOther());
|
||||
|
||||
rewriter.replaceOpWithNewOp<tosa::LogicalNotOp>(op, outType,
|
||||
greaterOp.getOutput());
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
template <>
|
||||
LogicalResult ConvertAtenOp<AtenClampOp>::matchAndRewrite(
|
||||
AtenClampOp op, OpAdaptor adaptor,
|
||||
|
@ -4663,6 +4689,7 @@ public:
|
|||
INSERT_ATENOP_PATTERN(AtenGatherOp);
|
||||
INSERT_ATENOP_PATTERN(AtenIndexTensorOp);
|
||||
INSERT_ATENOP_PATTERN(AtenWhereSelfOp);
|
||||
INSERT_ATENOP_PATTERN(AtenLeTensorOp);
|
||||
INSERT_ATENOP_PATTERN(AtenClampOp);
|
||||
INSERT_ATENOP_PATTERN(AtenArangeStartStepOp);
|
||||
INSERT_ATENOP_PATTERN(PrimNumToTensorScalarOp);
|
||||
|
|
Loading…
Reference in New Issue