aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/ops/constant_op.py
diff options
context:
space:
mode:
authorGravatar Manjunath Kudlur <keveman@gmail.com>2015-11-25 08:48:47 -0800
committerGravatar Manjunath Kudlur <keveman@gmail.com>2015-11-25 08:48:47 -0800
commit854f49bd43588c062b046384f239f64a3d819702 (patch)
treec2373bf71ef65ae4c116ea703947141281c1eace /tensorflow/python/ops/constant_op.py
parent9c3043ff3bf31a6a81810b4ce9e87ef936f1f529 (diff)
TensorFlow: Upstream changes to git
Changes: - Updates to docs - Several changes for Python 3 compatibility - Added license headers Base CL: 108710566
Diffstat (limited to 'tensorflow/python/ops/constant_op.py')
-rw-r--r--tensorflow/python/ops/constant_op.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tensorflow/python/ops/constant_op.py b/tensorflow/python/ops/constant_op.py
index 9cf5e99a1e..f2aaad37a9 100644
--- a/tensorflow/python/ops/constant_op.py
+++ b/tensorflow/python/ops/constant_op.py
@@ -105,10 +105,10 @@ import tensorflow.python.platform
import numpy as np
from tensorflow.core.framework import attr_value_pb2
+from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import tensor_util
-from tensorflow.python.framework import types
def constant(value, dtype=None, shape=None, name="Const"):
@@ -182,10 +182,10 @@ def _tensor_shape_tensor_conversion_function(s, dtype=None, name=None):
raise ValueError(
"Cannot convert a partially known TensorShape to a Tensor: %s" % s)
if dtype is not None:
- if dtype not in (types.int32, types.int64):
+ if dtype not in (dtypes.int32, dtypes.int64):
raise TypeError("Cannot convert a TensorShape to dtype: %s" % dtype)
else:
- dtype = types.int32
+ dtype = dtypes.int32
if name is None:
name = "shape_as_tensor"
return constant(s.as_list(), dtype=dtype, name=name)
@@ -197,10 +197,10 @@ def _dimension_tensor_conversion_function(d, dtype=None, name=None):
if d.value is None:
raise ValueError("Cannot convert an unknown Dimension to a Tensor: %s" % d)
if dtype is not None:
- if dtype not in (types.int32, types.int64):
+ if dtype not in (dtypes.int32, dtypes.int64):
raise TypeError("Cannot convert a TensorShape to dtype: %s" % dtype)
else:
- dtype = types.int32
+ dtype = dtypes.int32
if name is None:
name = "shape_as_tensor"
return constant(d.value, dtype=dtype, name=name)