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
89c124bc
Commit
89c124bc
authored
6 years ago
by
Tianqi Chen
Browse files
Options
Downloads
Patches
Plain Diff
Update tvm, fix lint due to pylint update (#423)
parent
e722dbcb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nnvm/python/nnvm/frontend/coreml.py
+7
-1
7 additions, 1 deletion
nnvm/python/nnvm/frontend/coreml.py
nnvm/tests/python/compiler/test_top_level2.py
+1
-0
1 addition, 0 deletions
nnvm/tests/python/compiler/test_top_level2.py
with
8 additions
and
1 deletion
nnvm/python/nnvm/frontend/coreml.py
+
7
−
1
View file @
89c124bc
# pylint: disable=invalid-name, unused-argument
"""
CoreML frontend.
"""
from
__future__
import
absolute_import
as
_abs
import
tvm
import
numpy
as
np
import
tvm
from
..
import
symbol
as
_sym
from
.common
import
SymbolTable
...
...
@@ -77,6 +78,7 @@ def ConvolutionLayerParams(op, insym, symtab):
return
ret
def
BatchnormLayerParams
(
op
,
insym
,
symtab
):
"""
Get layer of batchnorm parameter
"""
# this changes the symbol
if
op
.
instanceNormalization
:
raise
NotImplementedError
(
"
instance normalization not implemented
"
)
...
...
@@ -89,6 +91,7 @@ def BatchnormLayerParams(op, insym, symtab):
return
_sym
.
batch_norm
(
data
=
insym
,
**
params
)
def
ActivationParams
(
op
,
insym
,
symtab
):
"""
Get activation parameters
"""
whichActivation
=
op
.
WhichOneof
(
'
NonlinearityType
'
)
par
=
getattr
(
op
,
whichActivation
)
if
whichActivation
==
'
linear
'
:
...
...
@@ -129,6 +132,8 @@ def ActivationParams(op, insym, symtab):
betasym
=
symtab
.
new_const
(
beta
)
return
_sym
.
broadcast_mul
(
_sym
.
log
(
_sym
.
broadcast_add
(
_sym
.
exp
(
insym
),
betasym
)),
alphasym
)
else
:
raise
NotImplementedError
(
'
%s not implemented
'
%
whichActivation
)
def
ScaleLayerParams
(
op
,
insym
,
symtab
):
"""
Scale layer params.
"""
...
...
@@ -144,6 +149,7 @@ def ScaleLayerParams(op, insym, symtab):
return
ret
def
PoolingLayerParams
(
op
,
insym
,
symtab
):
"""
get pooling parameters
"""
if
op
.
globalPooling
:
if
op
.
type
==
0
:
return
_sym
.
global_max_pool2d
(
insym
)
...
...
This diff is collapsed.
Click to expand it.
nnvm/tests/python/compiler/test_top_level2.py
+
1
−
0
View file @
89c124bc
...
...
@@ -3,6 +3,7 @@ import numpy as np
import
tvm
from
tvm.contrib
import
graph_runtime
import
topi
import
topi.testing
import
nnvm.symbol
as
sym
import
nnvm.compiler
from
nnvm.testing.config
import
ctx_list
...
...
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