Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
c1f8042d
Commit
c1f8042d
authored
Mar 21, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in
3d1a30ff
parent
4888d1ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
tensorpack/libinfo.py
tensorpack/libinfo.py
+1
-1
tensorpack/tfutils/varmanip.py
tensorpack/tfutils/varmanip.py
+3
-1
No files found.
tensorpack/libinfo.py
View file @
c1f8042d
...
...
@@ -61,5 +61,5 @@ except ImportError:
# These lines will be programatically read/write by setup.py
# Don't touch them.
__version__
=
'0.9.
2
'
__version__
=
'0.9.
3
'
__git_version__
=
__version__
tensorpack/tfutils/varmanip.py
View file @
c1f8042d
...
...
@@ -77,6 +77,8 @@ class SessionUpdate(object):
# fix some common type incompatibility problems, but not all
def
upcast
(
vartype
,
valtype
):
# vartype: a tf dtype
# valtype: a numpy dtype
# allow up-casting
if
vartype
==
tf
.
float64
and
valtype
==
np
.
float32
:
return
np
.
float64
...
...
@@ -85,7 +87,7 @@ class SessionUpdate(object):
return
None
if
hasattr
(
value
,
'dtype'
):
vartype
=
var
.
dtype
vartype
=
var
.
dtype
.
as_numpy_dtype
if
vartype
!=
value
.
dtype
:
msg
=
"Variable {} has dtype {} but was given a value of dtype {}."
.
format
(
name
,
vartype
,
value
.
dtype
)
newtype
=
upcast
(
var
.
dtype
.
base_dtype
,
value
.
dtype
)
...
...
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