llvm/torch-mlir

Add support for `AtenDivTensorOp` `AtenDivScalarOp` with integer operands

开放

#456 创建于 2021年12月2日

 (1 条评论) (0 个反应) (0 位负责人)C++ (724 个派生)github user discovery
help wanted

仓库指标

星标
 (1,888 个星标)
PR 合并指标
 (平均合并 11天 19小时) (30 天内合并 18 个 PR)

描述

The type promotion rule for div ops are different when both operands are integers (integer operands are promoted to default float type) see https://pytorch.org/docs/stable/generated/torch.div.html.

To support this, AtenDivTensorOp and AtenDivScalarOp need to have some customized logic in RefineTypes rather than using visitBinaryBroadcastingOp or visitBinaryTensorScalarOp directly as it is now https://github.com/llvm/mlir-npcomp/blob/5475d02a0d03b2bda7ef9cc240773041d22a926b/lib/Dialect/Torch/Transforms/RefineTypes.cpp#L305-L308.

Once the changes in RefineTypes are made, the TorchToLinalg lowering code can be updated as well.

贡献者指南