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
1b1590b5
Commit
1b1590b5
authored
Oct 29, 2016
by
Ziheng Jiang
Committed by
Tianqi Chen
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rpow & fix 'Number' to 'Number_' (#76)
parent
7b36a19b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
nnvm/python/nnvm/symbol.py
+11
-5
No files found.
nnvm/python/nnvm/symbol.py
View file @
1b1590b5
...
...
@@ -43,13 +43,13 @@ class Symbol(SymbolBase):
def
__sub__
(
self
,
other
):
if
isinstance
(
other
,
Symbol
):
return
_internal
.
__sub_symbol__
(
self
,
other
)
if
isinstance
(
other
,
Number
):
if
isinstance
(
other
,
_
Number
):
return
_internal
.
__sub_scalar__
(
self
,
scalar
=
other
)
else
:
raise
TypeError
(
'type
%
s not supported'
%
str
(
type
(
other
)))
def
__rsub__
(
self
,
other
):
if
isinstance
(
other
,
Number
):
if
isinstance
(
other
,
_
Number
):
return
_internal
.
__rsub_scalar__
(
self
,
scalar
=
other
)
else
:
raise
TypeError
(
'type
%
s not supported'
%
str
(
type
(
other
)))
...
...
@@ -68,13 +68,13 @@ class Symbol(SymbolBase):
def
__div__
(
self
,
other
):
if
isinstance
(
other
,
Symbol
):
return
_internal
.
__div_symbol__
(
self
,
other
)
if
isinstance
(
other
,
Number
):
if
isinstance
(
other
,
_
Number
):
return
_internal
.
__div_scalar__
(
self
,
scalar
=
other
)
else
:
raise
TypeError
(
'type
%
s not supported'
%
str
(
type
(
other
)))
def
__rdiv__
(
self
,
other
):
if
isinstance
(
other
,
Number
):
if
isinstance
(
other
,
_
Number
):
return
_internal
.
__rdiv_scalar__
(
self
,
scalar
=
other
)
else
:
raise
TypeError
(
'type
%
s not supported'
%
str
(
type
(
other
)))
...
...
@@ -88,11 +88,17 @@ class Symbol(SymbolBase):
def
__pow__
(
self
,
other
):
if
isinstance
(
other
,
Symbol
):
return
_internal
.
__pow_symbol__
(
self
,
other
)
if
isinstance
(
other
,
Number
):
if
isinstance
(
other
,
_
Number
):
return
_internal
.
__pow_scalar__
(
self
,
scalar
=
other
)
else
:
raise
TypeError
(
'type
%
s not supported'
%
str
(
type
(
other
)))
def
__rpow__
(
self
,
other
):
if
isinstance
(
other
,
_Number
):
return
_internal
.
__rpow_scalar__
(
self
,
scalar
=
other
)
else
:
raise
TypeError
(
'type
%
s not supported'
%
str
(
type
(
other
)))
def
__neg__
(
self
):
return
self
.
__mul__
(
-
1.0
)
...
...
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