Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
f1e0a55a
Commit
f1e0a55a
authored
7 years ago
by
Yao Wang
Committed by
Tianqi Chen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Move dense compute back to python (#364)
parent
5884cd01
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nnvm/python/nnvm/top/nn.py
+7
-0
7 additions, 0 deletions
nnvm/python/nnvm/top/nn.py
nnvm/src/top/nn/nn.cc
+0
-15
0 additions, 15 deletions
nnvm/src/top/nn/nn.cc
with
7 additions
and
15 deletions
nnvm/python/nnvm/top/nn.py
+
7
−
0
View file @
f1e0a55a
...
...
@@ -51,6 +51,13 @@ reg.register_pattern("log_softmax", OpPattern.OPAQUE)
# dense
@reg.register_compute
(
"
dense
"
)
def
compute_dense
(
attrs
,
inputs
,
_
):
"""
Compute definition of dense
"""
if
attrs
.
get_bool
(
"
use_bias
"
):
return
topi
.
nn
.
dense
(
inputs
[
0
],
inputs
[
1
],
bias
=
inputs
[
2
])
return
topi
.
nn
.
dense
(
inputs
[
0
],
inputs
[
1
])
@reg.register_schedule
(
"
dense
"
)
def
schedule_dense
(
_
,
outs
,
target
):
"""
Schedule definition of dense
"""
...
...
This diff is collapsed.
Click to expand it.
nnvm/src/top/nn/nn.cc
+
0
−
15
View file @
f1e0a55a
...
...
@@ -82,21 +82,6 @@ If ``use_bias`` is set to be false, then the ``bias`` term is ignored.
.
set_attr
<
FListInputNames
>
(
"FListInputNames"
,
UseBiasListInputNames
<
DenseParam
>
)
.
set_attr
<
FInferShape
>
(
"FInferShape"
,
DenseInferShape
)
.
set_attr
<
FInferType
>
(
"FInferType"
,
ElemwiseType
<-
1
,
1
>
)
.
set_attr
<
FTVMCompute
>
(
"FTVMCompute"
,
[](
const
NodeAttrs
&
attrs
,
const
Array
<
Tensor
>&
inputs
,
const
Array
<
Tensor
>&
out_info
)
{
Tensor
bias_val
;
Tensor
*
bias
;
const
DenseParam
&
param
=
nnvm
::
get
<
DenseParam
>
(
attrs
.
parsed
);
if
(
param
.
use_bias
)
{
bias_val
=
inputs
[
2
];
bias
=
&
bias_val
;
}
else
{
bias
=
nullptr
;
}
return
Array
<
Tensor
>
{
topi
::
nn
::
dense
(
inputs
[
0
],
inputs
[
1
],
bias
)
};
})
.
set_attr
<
FGradient
>
(
"FGradient"
,
[](
const
NodePtr
&
n
,
const
std
::
vector
<
NodeEntry
>&
ograds
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment