aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/keras/python/keras/utils/generic_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/keras/python/keras/utils/generic_utils.py')
-rw-r--r--tensorflow/contrib/keras/python/keras/utils/generic_utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tensorflow/contrib/keras/python/keras/utils/generic_utils.py b/tensorflow/contrib/keras/python/keras/utils/generic_utils.py
index ed57144f9c..3428476b17 100644
--- a/tensorflow/contrib/keras/python/keras/utils/generic_utils.py
+++ b/tensorflow/contrib/keras/python/keras/utils/generic_utils.py
@@ -18,6 +18,7 @@ from __future__ import division
from __future__ import print_function
import marshal
+import os
import sys
import time
import types as python_types
@@ -195,7 +196,10 @@ def func_dump(func):
Returns:
A tuple `(code, defaults, closure)`.
"""
- code = marshal.dumps(func.__code__).decode('raw_unicode_escape')
+ if os.name == 'nt':
+ code = marshal.dumps(func.__code__).replace(b'\\',b'/').decode('raw_unicode_escape')
+ else:
+ code = marshal.dumps(func.__code__).decode('raw_unicode_escape')
defaults = func.__defaults__
if func.__closure__:
closure = tuple(c.cell_contents for c in func.__closure__)