Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c3077ec1
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c3077ec1
编写于
6月 28, 2023
作者:
W
winter-wang
提交者:
GitHub
6月 28, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[IR] add op_operand api for ir::Operation. (#54875)
上级
96652265
变更
18
显示空白变更内容
内联
并排
Showing
18 changed file
with
49 addition
and
49 deletion
+49
-49
paddle/fluid/ir/dialect/op_gen.py
paddle/fluid/ir/dialect/op_gen.py
+2
-2
paddle/fluid/ir/dialect/op_verify_gen.py
paddle/fluid/ir/dialect/op_verify_gen.py
+2
-2
paddle/fluid/ir/pass/pd_op_to_kernel_pass.cc
paddle/fluid/ir/pass/pd_op_to_kernel_pass.cc
+3
-5
paddle/fluid/ir/phi_kernel_adaptor/phi_kernel_util.cc
paddle/fluid/ir/phi_kernel_adaptor/phi_kernel_util.cc
+4
-4
paddle/ir/core/ir_printer.cc
paddle/ir/core/ir_printer.cc
+4
-4
paddle/ir/core/operation.cc
paddle/ir/core/operation.cc
+8
-3
paddle/ir/core/operation.h
paddle/ir/core/operation.h
+3
-1
paddle/ir/core/operation_utils.h
paddle/ir/core/operation_utils.h
+2
-2
paddle/ir/core/value.cc
paddle/ir/core/value.cc
+1
-1
paddle/ir/core/value.h
paddle/ir/core/value.h
+2
-2
paddle/ir/core/value_impl.h
paddle/ir/core/value_impl.h
+2
-2
paddle/ir/pattern_rewrite/pattern_rewrite_driver.cc
paddle/ir/pattern_rewrite/pattern_rewrite_driver.cc
+1
-1
test/cpp/ir/core/ir_op_test.cc
test/cpp/ir/core/ir_op_test.cc
+3
-7
test/cpp/ir/core/ir_program_test.cc
test/cpp/ir/core/ir_program_test.cc
+2
-2
test/cpp/ir/core/ir_value_test.cc
test/cpp/ir/core/ir_value_test.cc
+4
-4
test/cpp/ir/core/phi_kernel_adaptor.h
test/cpp/ir/core/phi_kernel_adaptor.h
+2
-2
test/cpp/ir/pass/pass_manager_test.cc
test/cpp/ir/pass/pass_manager_test.cc
+2
-3
test/cpp/ir/pattern_rewrite/pattern_rewrite_test.cc
test/cpp/ir/pattern_rewrite/pattern_rewrite_test.cc
+2
-2
未找到文件。
paddle/fluid/ir/dialect/op_gen.py
浏览文件 @
c3077ec1
...
...
@@ -78,7 +78,7 @@ op_n_attribute_declare_str = (
"static const char *attributes_name[{attribute_num}];"
)
OP_GET_INPUT_TEMPLATE
=
""" ir::OpOperand {input_name}() {{ return operation()->operand({input_index}); }}
OP_GET_INPUT_TEMPLATE
=
""" ir::OpOperand {input_name}() {{ return operation()->op
_op
erand({input_index}); }}
"""
OP_GET_OUTPUT_TEMPLATE
=
""" ir::OpResult {output_name}() {{ return operation()->result({output_index}); }}
"""
...
...
@@ -1046,7 +1046,7 @@ def GenBuildOutputs(
name
=
op_output_name_list
[
idx
]
)
build_output_str
+=
" argument.Add
Type
s(argument_outputs.begin(), argument_outputs.end());
\n
"
build_output_str
+=
" argument.Add
Output
s(argument_outputs.begin(), argument_outputs.end());
\n
"
return
build_output_str
...
...
paddle/fluid/ir/dialect/op_verify_gen.py
浏览文件 @
c3077ec1
...
...
@@ -54,12 +54,12 @@ INPUT_VECTORTYPE_CHECK_TEMPLATE = """
phi::errors::PreconditionNotMet("Type validation failed for the {index}th input."));
}}"""
INPUT_OPTIONAL_TYPE_CHECK_TEMPLATE
=
"""
if (auto val = (*this)->operand({index})) {{
if (auto val = (*this)->op
_op
erand({index})) {{
PADDLE_ENFORCE(val.type().isa<{standard}>(),
phi::errors::PreconditionNotMet("Type validation failed for the {index}th input."));
}}"""
INPUT_OPTIONAL_VECTORTYPE_CHECK_TEMPLATE
=
"""
if (auto val = (*this)->operand({index})) {{
if (auto val = (*this)->op
_op
erand({index})) {{
if (auto vec_type = val.type().dyn_cast<ir::VectorType>()) {{
for (size_t i = 0; i < vec_type.size(); i++) {{
PADDLE_ENFORCE(vec_type[i].isa<{standard}>(),
...
...
paddle/fluid/ir/pass/pd_op_to_kernel_pass.cc
浏览文件 @
c3077ec1
...
...
@@ -86,7 +86,6 @@ phi::KernelKey GetKernelKey(
dialect
::
DenseTensorType
type
=
op
->
operand
(
in_index
)
.
source
()
.
type
()
.
dyn_cast
<
paddle
::
dialect
::
DenseTensorType
>
();
kernel_data_type
=
TransToPhiDataType
(
type
.
dtype
());
...
...
@@ -108,7 +107,7 @@ phi::KernelKey GetKernelKey(
if
(
op
->
name
()
==
"pd.uniform"
)
{
// try to process uniform, use shape to determin backend
// TODO(phlrain): shuold support other initilize op
auto
define_op
=
op
->
operand
(
0
).
source
().
GetDefiningOp
();
auto
define_op
=
op
->
operand
(
0
).
GetDefiningOp
();
if
(
define_op
->
name
()
==
"pd.full_int_array"
)
{
auto
shape
=
define_op
->
attributes
()
.
at
(
"value"
)
...
...
@@ -140,8 +139,7 @@ phi::KernelKey GetKernelKey(
if
((
input_info
.
size
()
>
i
)
&&
input_info
[
i
].
is_mutable_attribute
)
{
continue
;
}
auto
input_tmp
=
op
->
operand
(
i
).
source
();
auto
input_tmp
=
op
->
operand
(
i
);
auto
new_input_tmp
=
map_value_pair
.
at
(
input_tmp
);
auto
input_type
=
new_input_tmp
.
type
();
...
...
@@ -262,7 +260,7 @@ std::unique_ptr<ir::Program> PdOpLowerToKernelPass(ir::Program* prog) {
if
((
*
it
)
->
num_operands
()
>
0
)
{
for
(
size_t
i
=
0
;
i
<
(
*
it
)
->
num_operands
();
++
i
)
{
auto
cur_in
=
(
*
it
)
->
operand
(
i
)
.
source
()
;
auto
cur_in
=
(
*
it
)
->
operand
(
i
);
auto
new_in
=
map_value_pair
.
at
(
cur_in
);
auto
new_in_type
=
new_in
.
type
();
...
...
paddle/fluid/ir/phi_kernel_adaptor/phi_kernel_util.cc
浏览文件 @
c3077ec1
...
...
@@ -103,7 +103,7 @@ void BuildScope(ir::Block* block,
auto
tensor_array
=
var
->
GetMutable
<
paddle
::
framework
::
TensorRefArray
>
();
for
(
size_t
i
=
0
;
i
<
input_num
;
++
i
)
{
auto
ptr
=
(
*
it
)
->
operand
(
i
)
.
source
()
;
auto
ptr
=
(
*
it
)
->
operand
(
i
);
PADDLE_ENFORCE_EQ
(
name_map
->
count
(
ptr
),
true
,
...
...
@@ -119,7 +119,7 @@ void BuildScope(ir::Block* block,
if
(
input_num
>
0
)
{
for
(
size_t
i
=
0
;
i
<
input_num
;
++
i
)
{
auto
ptr
=
(
*
it
)
->
operand
(
i
)
.
source
()
;
auto
ptr
=
(
*
it
)
->
operand
(
i
);
std
::
string
name
;
if
(
name_map
->
find
(
ptr
)
!=
name_map
->
end
())
{
name
=
name_map
->
at
(
ptr
);
...
...
@@ -191,7 +191,7 @@ void BuildInferMetaContext(
auto
&
t
=
vec_param_list
[
input_index
];
if
(
input_index_map
.
count
(
t
))
{
// get information from input
ir
::
Value
ptr
=
op
->
operand
(
input_index_map
[
t
])
.
source
()
;
ir
::
Value
ptr
=
op
->
operand
(
input_index_map
[
t
]);
auto
in_var_name
=
name_map
.
at
(
ptr
);
if
(
mutable_attr_type_map
.
count
(
t
))
{
...
...
@@ -316,7 +316,7 @@ void BuildPhiKernelContext(
for
(
auto
&
t
:
vec_param_list
)
{
if
(
input_index_map
.
count
(
t
))
{
// get information from input
ir
::
Value
ptr
=
op
->
operand
(
input_index_map
[
t
])
.
source
()
;
ir
::
Value
ptr
=
op
->
operand
(
input_index_map
[
t
]);
auto
in_var_name
=
name_map
.
at
(
ptr
);
if
(
input_map
!=
nullptr
)
{
// only deal with single input for now, [todo] need support multi input
...
...
paddle/ir/core/ir_printer.cc
浏览文件 @
c3077ec1
...
...
@@ -230,7 +230,7 @@ void IrPrinter::PrintOpOperands(Operation* op) {
std
::
vector
<
Value
>
op_operands
;
op_operands
.
reserve
(
num_op_operands
);
for
(
size_t
idx
=
0
;
idx
<
num_op_operands
;
idx
++
)
{
op_operands
.
push_back
(
op
->
operand
(
idx
)
.
source
()
);
op_operands
.
push_back
(
op
->
operand
(
idx
));
}
PrintInterleave
(
op_operands
.
begin
(),
...
...
@@ -245,11 +245,11 @@ void IrPrinter::PrintOperandsType(Operation* op) {
std
::
vector
<
Type
>
op_operand_types
;
op_operand_types
.
reserve
(
num_op_operands
);
for
(
size_t
idx
=
0
;
idx
<
num_op_operands
;
idx
++
)
{
auto
op_operand
=
op
->
operand
(
idx
);
auto
op_operand
=
op
->
op
_op
erand
(
idx
);
if
(
op_operand
)
{
op_operand_types
.
push_back
(
op
->
operand
(
idx
).
source
()
.
type
());
op_operand_types
.
push_back
(
op
_operand
.
type
());
}
else
{
op_operand_types
.
push_back
(
Type
(
nullptr
));
op_operand_types
.
push_back
(
Type
());
}
}
os
<<
" ("
;
...
...
paddle/ir/core/operation.cc
浏览文件 @
c3077ec1
...
...
@@ -130,7 +130,7 @@ void Operation::Destroy() {
// 4. Deconstruct OpOperand.
for
(
size_t
idx
=
0
;
idx
<
num_operands_
;
idx
++
)
{
operand
(
idx
).
impl
()
->~
OpOperandImpl
();
op
_op
erand
(
idx
).
impl
()
->~
OpOperandImpl
();
}
// 5. Free memory.
uint32_t
max_inline_result_num
=
...
...
@@ -184,13 +184,18 @@ ir::OpResult Operation::result(uint32_t index) const {
}
}
ir
::
OpOperand
Operation
::
operand
(
uint32_t
index
)
const
{
OpOperand
Operation
::
op_
operand
(
uint32_t
index
)
const
{
if
(
index
>=
num_operands_
)
{
IR_THROW
(
"index exceeds OP input range."
);
}
const
char
*
ptr
=
reinterpret_cast
<
const
char
*>
(
this
)
+
sizeof
(
Operation
)
+
(
index
)
*
sizeof
(
detail
::
OpOperandImpl
);
return
ir
::
OpOperand
(
reinterpret_cast
<
const
detail
::
OpOperandImpl
*>
(
ptr
));
return
OpOperand
(
reinterpret_cast
<
const
detail
::
OpOperandImpl
*>
(
ptr
));
}
Value
Operation
::
operand
(
uint32_t
index
)
const
{
OpOperand
val
=
op_operand
(
index
);
return
val
?
val
.
source
()
:
Value
();
}
std
::
string
Operation
::
name
()
const
{
...
...
paddle/ir/core/operation.h
浏览文件 @
c3077ec1
...
...
@@ -53,7 +53,9 @@ class IR_API alignas(8) Operation final {
OpResult
result
(
uint32_t
index
)
const
;
OpOperand
operand
(
uint32_t
index
)
const
;
OpOperand
op_operand
(
uint32_t
index
)
const
;
Value
operand
(
uint32_t
index
)
const
;
/// Returns the region held by this operation at position 'index'.
Region
&
region
(
unsigned
index
);
...
...
paddle/ir/core/operation_utils.h
浏览文件 @
c3077ec1
...
...
@@ -61,7 +61,7 @@ struct OperationArgument {
void
AddOutput
(
Type
type
)
{
output_types
.
emplace_back
(
type
);
}
template
<
class
InputIt
>
void
Add
Type
s
(
InputIt
first
,
InputIt
last
);
void
Add
Output
s
(
InputIt
first
,
InputIt
last
);
/// Add an attribute with the specified name.
void
AddAttribute
(
const
std
::
string
&
name
,
Attribute
attr
)
{
...
...
@@ -86,7 +86,7 @@ void OperationArgument::AddOperands(InputIt first, InputIt last) {
}
}
template
<
class
InputIt
>
void
OperationArgument
::
Add
Type
s
(
InputIt
first
,
InputIt
last
)
{
void
OperationArgument
::
Add
Output
s
(
InputIt
first
,
InputIt
last
)
{
while
(
first
!=
last
)
{
output_types
.
emplace_back
(
*
first
++
);
}
...
...
paddle/ir/core/value.cc
浏览文件 @
c3077ec1
...
...
@@ -47,7 +47,7 @@ Operation *OpOperand::owner() const { return impl()->owner(); }
void
OpOperand
::
RemoveFromUdChain
()
{
return
impl
()
->
RemoveFromUdChain
();
}
detail
::
OpOperandImpl
*
OpOperand
::
impl
()
const
{
IR_ENFORCE
(
impl_
,
"Can't use impl() interface while operand is null."
);
IR_ENFORCE
(
impl_
,
"Can't use impl() interface while op
_op
erand is null."
);
return
impl_
;
}
// Value
...
...
paddle/ir/core/value.h
浏览文件 @
c3077ec1
...
...
@@ -28,8 +28,8 @@ class OpResultImpl;
}
// namespace detail
///
/// \brief OpOperand class represents the op
erand of operation. This class only
/// provides interfaces, for specific implementation, see Impl class.
/// \brief OpOperand class represents the op
_operand of operation. This class
///
only
provides interfaces, for specific implementation, see Impl class.
///
class
IR_API
OpOperand
{
public:
...
...
paddle/ir/core/value_impl.h
浏览文件 @
c3077ec1
...
...
@@ -35,7 +35,7 @@ class OpOperandImpl {
void
set_source
(
Value
value
);
/// Remove this operand from the current use list.
/// Remove this op
_op
erand from the current use list.
void
RemoveFromUdChain
();
~
OpOperandImpl
();
...
...
@@ -62,7 +62,7 @@ class OpOperandImpl {
/// \brief ValueImpl is the base class of all derived Value classes such as
/// OpResultImpl. This class defines all the information and usage interface in
/// the IR Value. Each Value include three attributes:
/// (1) type: ir::Type; (2) UD-chain of value: OpOperandImpl*, first operand
/// (1) type: ir::Type; (2) UD-chain of value: OpOperandImpl*, first op
_op
erand
/// address with offset of this value; (3) index: the position where the output
/// list of the parent operator.
///
...
...
paddle/ir/pattern_rewrite/pattern_rewrite_driver.cc
浏览文件 @
c3077ec1
...
...
@@ -131,7 +131,7 @@ class GreedyPatternRewriteDriver : public ir::PatternRewriter {
void
NotifyOperationRemoved
(
ir
::
Operation
*
op
)
override
{
for
(
uint32_t
i
=
0
;
i
<
op
->
num_operands
();
++
i
)
{
AddOperandToWorklist
(
op
->
operand
(
i
)
.
source
()
);
AddOperandToWorklist
(
op
->
operand
(
i
));
}
for
(
uint32_t
i
=
0
;
i
<
op
->
num_regions
();
++
i
)
{
auto
&
region
=
op
->
region
(
i
);
...
...
test/cpp/ir/core/ir_op_test.cc
浏览文件 @
c3077ec1
...
...
@@ -109,13 +109,9 @@ class Operation1 : public ir::Op<Operation1> {
std
::
unordered_map
<
std
::
string
,
ir
::
Attribute
>
attributes
=
CreateAttributeMap
({
"op1_attr1"
,
"op1_attr2"
},
{
"op1_attr1"
,
"op1_attr2"
});
argument
.
AddOperands
<
std
::
vector
<
ir
::
OpResult
>::
iterator
>
(
inputs
.
begin
(),
inputs
.
end
());
argument
.
AddTypes
<
std
::
vector
<
ir
::
Type
>::
iterator
>
(
output_types
.
begin
(),
output_types
.
end
());
argument
.
AddAttributes
<
std
::
unordered_map
<
std
::
string
,
ir
::
Attribute
>::
iterator
>
(
attributes
.
begin
(),
attributes
.
end
());
argument
.
AddOperands
(
inputs
.
begin
(),
inputs
.
end
());
argument
.
AddOutputs
(
output_types
.
begin
(),
output_types
.
end
());
argument
.
AddAttributes
(
attributes
.
begin
(),
attributes
.
end
());
}
};
const
char
*
Operation1
::
attributes_name
[
attributes_num
]
=
{
"op1_attr1"
,
...
...
test/cpp/ir/core/ir_program_test.cc
浏览文件 @
c3077ec1
...
...
@@ -174,9 +174,9 @@ TEST(program_test, program) {
// (8) Def SetParameterOp(c, "c")
auto
op4
=
builder
.
Build
<
ir
::
SetParameterOp
>
(
op3
->
result
(
0
),
"c"
);
EXPECT_EQ
(
op4
->
operand
(
0
).
type
().
dialect
().
id
(),
paddle_dialect
->
id
());
EXPECT_EQ
(
op4
->
op
_op
erand
(
0
).
type
().
dialect
().
id
(),
paddle_dialect
->
id
());
Interface
*
c_interface
=
op4
->
operand
(
0
).
type
().
dialect
().
GetRegisteredInterface
<
Interface
>
();
op4
->
op
_op
erand
(
0
).
type
().
dialect
().
GetRegisteredInterface
<
Interface
>
();
// ir::Parameter *parameter_c =
// c_interface->VariableToParameter(variable_c.get());
std
::
unique_ptr
<
ir
::
Parameter
>
parameter_c
=
...
...
test/cpp/ir/core/ir_value_test.cc
浏览文件 @
c3077ec1
...
...
@@ -91,10 +91,10 @@ TEST(value_test, value_test) {
// Test 2: op1_first_output -> op4_first_input
ir
::
OpResult
op1_first_output
=
op1
->
result
(
0
);
ir
::
OpOperand
op4_first_input
=
op4
->
operand
(
0
);
ir
::
OpOperand
op4_first_input
=
op4
->
op
_op
erand
(
0
);
EXPECT_EQ
(
op1_first_output
.
first_use
(),
op4_first_input
);
ir
::
OpOperand
op3_first_input
=
op3
->
operand
(
0
);
ir
::
OpOperand
op3_first_input
=
op3
->
op
_op
erand
(
0
);
EXPECT_EQ
(
op4_first_input
.
next_use
(),
op3_first_input
);
EXPECT_EQ
(
op3_first_input
.
next_use
(),
nullptr
);
...
...
@@ -110,11 +110,11 @@ TEST(value_test, value_test) {
// a = OP1(); b = OP2(); c = OP3(a, b); d, e, f, g, h, i, j = OP4(a, c);
//
c
.
ReplaceUsesWithIf
(
b
,
[](
ir
::
OpOperand
)
{
return
true
;
});
EXPECT_EQ
(
op4
->
operand
(
1
)
.
source
()
,
b
);
EXPECT_EQ
(
op4
->
operand
(
1
),
b
);
EXPECT_TRUE
(
c
.
use_empty
());
b
.
ReplaceAllUsesWith
(
a
);
EXPECT_EQ
(
op4
->
operand
(
1
)
.
source
()
,
a
);
EXPECT_EQ
(
op4
->
operand
(
1
),
a
);
EXPECT_TRUE
(
b
.
use_empty
());
// destroy
...
...
test/cpp/ir/core/phi_kernel_adaptor.h
浏览文件 @
c3077ec1
...
...
@@ -56,7 +56,7 @@ void BuildScope(ir::Block* block,
int
input
=
(
*
it
)
->
num_operands
();
if
(
input
>
0
)
{
for
(
int
i
=
0
;
i
<
input
;
++
i
)
{
auto
ptr
=
(
*
it
)
->
operand
(
i
)
.
source
()
;
auto
ptr
=
(
*
it
)
->
operand
(
i
);
std
::
string
name
;
if
(
name_map
->
find
(
ptr
)
!=
name_map
->
end
())
{
name
=
name_map
->
at
(
ptr
);
...
...
@@ -130,7 +130,7 @@ void build_context(ir::Operation* op,
for
(
auto
&
t
:
vec_param_list
)
{
if
(
input_index_map
.
count
(
t
))
{
// get information from input
ir
::
Value
ptr
=
op
->
operand
(
input_index_map
[
t
])
.
source
()
;
ir
::
Value
ptr
=
op
->
operand
(
input_index_map
[
t
]);
auto
in_var_name
=
name_map
.
at
(
ptr
);
if
(
mutable_attr_type_map
.
count
(
t
))
{
...
...
test/cpp/ir/pass/pass_manager_test.cc
浏览文件 @
c3077ec1
...
...
@@ -247,10 +247,9 @@ TEST(pass_manager, PassManager) {
// (7) Def SetParameterOp(c, "c")
auto
op4
=
builder
.
Build
<
ir
::
SetParameterOp
>
(
op3
->
result
(
0
),
"c"
);
EXPECT_EQ
(
op4
->
operand
(
0
).
source
().
type
().
dialect
().
id
(),
paddle_dialect
->
id
());
EXPECT_EQ
(
op4
->
operand
(
0
).
type
().
dialect
().
id
(),
paddle_dialect
->
id
());
Interface
*
c_interface
=
op4
->
operand
(
0
).
type
().
dialect
().
GetRegisteredInterface
<
Interface
>
();
op4
->
op
_op
erand
(
0
).
type
().
dialect
().
GetRegisteredInterface
<
Interface
>
();
// ir::Parameter *parameter_c =
// c_interface->VariableToParameter(variable_c.get());
...
...
test/cpp/ir/pattern_rewrite/pattern_rewrite_test.cc
浏览文件 @
c3077ec1
...
...
@@ -181,7 +181,7 @@ class TransposePatternRewrite
bool
MatchAndRewrite
(
paddle
::
dialect
::
TransposeOp
op
,
ir
::
PatternRewriter
&
rewriter
)
const
override
{
auto
prev_op
=
op
->
operand
(
0
).
source
().
GetDefiningOp
();
auto
prev_op
=
op
->
operand
(
0
).
GetDefiningOp
();
std
::
vector
<
int
>
axis_last
=
GetAxis
(
op
);
auto
prev_trans_op
=
prev_op
->
dyn_cast
<
paddle
::
dialect
::
TransposeOp
>
();
if
(
prev_trans_op
)
{
...
...
@@ -191,7 +191,7 @@ class TransposePatternRewrite
auto
new_perm
=
GetPerm
(
axis_first
,
axis_last
);
rewriter
.
SetInsertionPoint
(
op
);
auto
new_op
=
rewriter
.
Build
<
paddle
::
dialect
::
TransposeOp
>
(
prev_op
->
operand
(
0
).
source
().
GetDefiningOp
()
->
result
(
0
),
new_perm
);
prev_op
->
operand
(
0
).
GetDefiningOp
()
->
result
(
0
),
new_perm
);
rewriter
.
ReplaceOp
(
op
,
{
new_op
.
out
()});
return
true
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录