提交 7d822816 编写于 作者: A A. Unique TensorFlower 提交者: TensorFlower Gardener

Use float32 and float64 instead of float and double.

Change: 125783060
上级 2d0dcd9f
...@@ -239,7 +239,7 @@ def abs(x, name=None): ...@@ -239,7 +239,7 @@ def abs(x, name=None):
number. number.
Args: Args:
x: A `Tensor` or `SparseTensor` of type `float`, `double`, `int32`, or x: A `Tensor` or `SparseTensor` of type `float32`, `float64`, `int32`, or
`int64`. `int64`.
name: A name for the operation (optional). name: A name for the operation (optional).
...@@ -310,7 +310,7 @@ def complex_abs(x, name=None): ...@@ -310,7 +310,7 @@ def complex_abs(x, name=None):
r"""Computes the complex absolute value of a tensor. r"""Computes the complex absolute value of a tensor.
Given a tensor `x` of complex numbers, this operation returns a tensor of type Given a tensor `x` of complex numbers, this operation returns a tensor of type
`float` or `double` that is the absolute value of each element in `x`. All `float32` or `float64` that is the absolute value of each element in `x`. All
elements in `x` must be complex numbers of the form \\(a + bj\\). The elements in `x` must be complex numbers of the form \\(a + bj\\). The
absolute value is computed as \\( \sqrt{a^2 + b^2}\\). absolute value is computed as \\( \sqrt{a^2 + b^2}\\).
...@@ -372,10 +372,10 @@ def pow(x, y, name=None): ...@@ -372,10 +372,10 @@ def pow(x, y, name=None):
``` ```
Args: Args:
x: A `Tensor` of type `float`, `double`, `int32`, `int64`, `complex64`, or x: A `Tensor` of type `float32`, `float64`, `int32`, `int64`, `complex64`,
`complex128`. or `complex128`.
y: A `Tensor` of type `float`, `double`, `int32`, `int64`, `complex64`, or y: A `Tensor` of type `float32`, `float64`, `int32`, `int64`, `complex64`,
`complex128`. or `complex128`.
name: A name for the operation (optional). name: A name for the operation (optional).
Returns: Returns:
...@@ -429,7 +429,7 @@ def real(input, name=None): ...@@ -429,7 +429,7 @@ def real(input, name=None):
"""Returns the real part of a complex number. """Returns the real part of a complex number.
Given a tensor `input` of complex numbers, this operation returns a tensor of Given a tensor `input` of complex numbers, this operation returns a tensor of
type `float` or `double` that is the real part of each element in `input`. type `float32` or `float64` that is the real part of each element in `input`.
All elements in `input` must be complex numbers of the form \\(a + bj\\), All elements in `input` must be complex numbers of the form \\(a + bj\\),
where *a* is the real part returned by this operation and *b* is the where *a* is the real part returned by this operation and *b* is the
imaginary part. imaginary part.
...@@ -447,7 +447,7 @@ def real(input, name=None): ...@@ -447,7 +447,7 @@ def real(input, name=None):
name: A name for the operation (optional). name: A name for the operation (optional).
Returns: Returns:
A `Tensor` of type `float` or `double`. A `Tensor` of type `float32` or `float64`.
""" """
with ops.op_scope([input], name, "Real") as name: with ops.op_scope([input], name, "Real") as name:
return gen_math_ops.real(input, Tout=input.dtype.real_dtype, name=name) return gen_math_ops.real(input, Tout=input.dtype.real_dtype, name=name)
...@@ -457,7 +457,7 @@ def imag(input, name=None): ...@@ -457,7 +457,7 @@ def imag(input, name=None):
"""Returns the imaginary part of a complex number. """Returns the imaginary part of a complex number.
Given a tensor `input` of complex numbers, this operation returns a tensor of Given a tensor `input` of complex numbers, this operation returns a tensor of
type `float` or `double` that is the imaginary part of each element in type `float32` or `float64` that is the imaginary part of each element in
`input`. All elements in `input` must be complex numbers of the form \\(a + `input`. All elements in `input` must be complex numbers of the form \\(a +
bj\\), where *a* is the real part and *b* is the imaginary part returned by bj\\), where *a* is the real part and *b* is the imaginary part returned by
this operation. this operation.
...@@ -474,7 +474,7 @@ def imag(input, name=None): ...@@ -474,7 +474,7 @@ def imag(input, name=None):
name: A name for the operation (optional). name: A name for the operation (optional).
Returns: Returns:
A `Tensor` of type `float` or `double`. A `Tensor` of type `float32` or `float64`.
""" """
with ops.op_scope([input], name, "Imag") as name: with ops.op_scope([input], name, "Imag") as name:
return gen_math_ops.imag(input, Tout=input.dtype.real_dtype, name=name) return gen_math_ops.imag(input, Tout=input.dtype.real_dtype, name=name)
...@@ -491,7 +491,7 @@ def round(x, name=None): ...@@ -491,7 +491,7 @@ def round(x, name=None):
``` ```
Args: Args:
x: A `Tensor` of type `float` or `double`. x: A `Tensor` of type `float32` or `float64`.
name: A name for the operation (optional). name: A name for the operation (optional).
Returns: Returns:
...@@ -1213,7 +1213,7 @@ def matmul(a, b, ...@@ -1213,7 +1213,7 @@ def matmul(a, b,
possibly after transposition. possibly after transposition.
Both matrices must be of the same type. The supported types are: Both matrices must be of the same type. The supported types are:
`float`, `double`, `int32`, `complex64`. `float32`, `float64`, `int32`, `complex64`.
Either matrix can be transposed on the fly by setting the corresponding flag Either matrix can be transposed on the fly by setting the corresponding flag
to `True`. This is `False` by default. to `True`. This is `False` by default.
...@@ -1237,7 +1237,7 @@ def matmul(a, b, ...@@ -1237,7 +1237,7 @@ def matmul(a, b,
``` ```
Args: Args:
a: `Tensor` of type `float`, `double`, `int32` or `complex64`. a: `Tensor` of type `float32`, `float64`, `int32` or `complex64`.
b: `Tensor` with same type as `a`. b: `Tensor` with same type as `a`.
transpose_a: If `True`, `a` is transposed before multiplication. transpose_a: If `True`, `a` is transposed before multiplication.
transpose_b: If `True`, `b` is transposed before multiplication. transpose_b: If `True`, `b` is transposed before multiplication.
...@@ -1489,7 +1489,7 @@ def sigmoid(x, name=None): ...@@ -1489,7 +1489,7 @@ def sigmoid(x, name=None):
Specifically, `y = 1 / (1 + exp(-x))`. Specifically, `y = 1 / (1 + exp(-x))`.
Args: Args:
x: A Tensor with type `float`, `double`, `int32`, `complex64`, `int64`, x: A Tensor with type `float32`, `float64`, `int32`, `complex64`, `int64`,
or `qint32`. or `qint32`.
name: A name for the operation (optional). name: A name for the operation (optional).
...@@ -1506,7 +1506,7 @@ def tanh(x, name=None): ...@@ -1506,7 +1506,7 @@ def tanh(x, name=None):
"""Computes hyperbolic tangent of `x` element-wise. """Computes hyperbolic tangent of `x` element-wise.
Args: Args:
x: A Tensor with type `float`, `double`, `int32`, `complex64`, `int64`, x: A Tensor with type `float32`, `float64`, `int32`, `complex64`, `int64`,
or `qint32`. or `qint32`.
name: A name for the operation (optional). name: A name for the operation (optional).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册