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
420ec786
Commit
420ec786
authored
Nov 01, 2018
by
Haichen Shen
Committed by
Tianqi Chen
Nov 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NNVM][OP] Allow two input tensors with different type in reshape_like op (#2052)
parent
c8245e9a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
nnvm/python/nnvm/frontend/mxnet.py
+2
-1
nnvm/src/top/tensor/transform.cc
+10
-1
No files found.
nnvm/python/nnvm/frontend/mxnet.py
View file @
420ec786
...
...
@@ -290,7 +290,8 @@ _identity_list = ['__add_scalar__', '__add_symbol__', '__div_scalar__',
'elemwise_div'
,
'elemwise_mul'
,
'elemwise_sub'
,
'exp'
,
'flatten'
,
'log'
,
'log_softmax'
,
'max'
,
'min'
,
'negative'
,
'ones_like'
,
'relu'
,
'sigmoid'
,
'slice_like'
,
'softmax'
,
'sum'
,
'tanh'
,
'transpose'
,
'zeros_like'
,
'gather_nd'
]
'sum'
,
'tanh'
,
'transpose'
,
'zeros_like'
,
'gather_nd'
,
'reshape_like'
]
_convert_map
=
{
'_copy'
:
_rename
(
'copy'
),
...
...
nnvm/src/top/tensor/transform.cc
View file @
420ec786
...
...
@@ -631,6 +631,15 @@ The significance of each is explained below:
})
.
set_support_level
(
3
);
inline
bool
ReshapeLikeInferType
(
const
NodeAttrs
&
attrs
,
std
::
vector
<
int
>
*
in_attrs
,
std
::
vector
<
int
>
*
out_attrs
)
{
CHECK_EQ
(
in_attrs
->
size
(),
2U
);
CHECK_EQ
(
out_attrs
->
size
(),
1U
);
NNVM_ASSIGN_OUTPUT_TYPE
(
attrs
,
*
out_attrs
,
0
,
(
*
in_attrs
)[
0
]);
return
true
;
}
NNVM_REGISTER_OP
(
reshape_like
)
.
describe
(
R"code(Reshapes the input array by the size of another array.
For an input array with shape ``(d1, d2, ..., dk)``, `reshape_like` operation reshapes
...
...
@@ -651,7 +660,7 @@ the input array into an output array with the same shape as the second input arr
NNVM_ASSIGN_OUTPUT_SHAPE
(
attrs
,
*
out_attrs
,
0
,
in_attrs
->
at
(
1
));
return
true
;
})
.
set_attr
<
FInferType
>
(
"FInferType"
,
ElemwiseType
<
2
,
1
>
)
.
set_attr
<
FInferType
>
(
"FInferType"
,
ReshapeLikeInferType
)
// never transform layout of the second input array.
.
set_attr
<
FCorrectLayout
>
(
"FCorrectLayout"
,
ElemwiseFixedLayoutUnknownOut
<
1
,
1
>
)
.
set_attr
<
FGradient
>
(
...
...
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