Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
6961ad14
Commit
6961ad14
authored
Oct 06, 2019
by
Animesh Jain
Committed by
Yizhi Liu
Oct 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Relay][AlterOp] Minor refactor. (#4064)
parent
d703fb4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/relay/pass/alter_op_layout.h
+3
-3
No files found.
src/relay/pass/alter_op_layout.h
View file @
6961ad14
...
@@ -53,10 +53,10 @@ inline Layout AdjustSubordinateFactors(const Layout& src_layout, const Layout& o
...
@@ -53,10 +53,10 @@ inline Layout AdjustSubordinateFactors(const Layout& src_layout, const Layout& o
for
(
auto
axis
:
src_layout
->
axes
)
{
for
(
auto
axis
:
src_layout
->
axes
)
{
if
(
!
LayoutAxis
::
Get
(
axis
).
IsPrimal
())
{
if
(
!
LayoutAxis
::
Get
(
axis
).
IsPrimal
())
{
// 1) Find the corresponding dual axis
// 1) Find the corresponding dual axis
auto
dual_axis
=
LayoutAxis
::
Get
(
axis
).
ToPrimal
().
name
()[
0
]
;
const
auto
&
dual_axis
=
LayoutAxis
::
Get
(
axis
).
ToPrimal
()
;
// 2) Find the index of this dual axis in old_layout
// 2) Find the index of this dual axis in old_layout
int
old_axis
=
old_layout
.
IndexOf
(
LayoutAxis
::
Get
(
dual_axis
)
);
int
old_axis
=
old_layout
.
IndexOf
(
dual_axis
);
// 3) Find the shape of this index in old_shape
// 3) Find the shape of this index in old_shape
auto
shape_val
=
old_shape
[
old_axis
];
auto
shape_val
=
old_shape
[
old_axis
];
...
@@ -72,7 +72,7 @@ inline Layout AdjustSubordinateFactors(const Layout& src_layout, const Layout& o
...
@@ -72,7 +72,7 @@ inline Layout AdjustSubordinateFactors(const Layout& src_layout, const Layout& o
// 4) b) If shape is not 1, retain the factor.
// 4) b) If shape is not 1, retain the factor.
if
(
!
is_shape_one
)
{
if
(
!
is_shape_one
)
{
auto
new_shape_val
=
src_layout
.
FactorOf
(
LayoutAxis
::
Get
(
dual_axis
)
);
auto
new_shape_val
=
src_layout
.
FactorOf
(
dual_axis
);
new_layout
+=
std
::
to_string
(
new_shape_val
);
new_layout
+=
std
::
to_string
(
new_shape_val
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment