Skip to content

Commit 3ae663c

Browse files
martinwicketensorflower-gardener
authored andcommitted
Merge changes from github.
Change: 117301677
1 parent a0d21ec commit 3ae663c

52 files changed

Lines changed: 2086 additions & 300 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
## Set up python-related environment settings
44
while true; do

tensorflow/cc/ops/const_op.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ DEFINE_CONST(bool, bool_val);
8787
DEFINE_CONST_IMPL(complex64, proto.add_scomplex_val(t.begin()->real());
8888
proto.add_scomplex_val(t.begin()->imag()););
8989

90+
DEFINE_CONST_IMPL(complex128, proto.add_dcomplex_val(t.begin()->real());
91+
proto.add_dcomplex_val(t.begin()->imag()););
92+
9093
Node* Const(StringPiece s, const GraphDefBuilder::Options& options) {
9194
if (options.HaveError()) return nullptr;
9295
NodeBuilder node_builder(options.GetNameForOp(OpName()), OpName(),

tensorflow/cc/ops/const_op.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ DECLARE_CONST(uint8);
4949
DECLARE_CONST(int16);
5050
DECLARE_CONST(int8);
5151
DECLARE_CONST(complex64);
52+
DECLARE_CONST(complex128);
5253
DECLARE_CONST(int64);
5354
DECLARE_CONST(bool);
5455

tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import threading
2222
import uuid
2323

24+
from six.moves import range
25+
2426
from tensorflow.python.framework import dtypes
2527
from tensorflow.python.framework import ops
2628
from tensorflow.python.framework.load_library import load_op_library
@@ -223,7 +225,7 @@ def _linear_predictions(self, examples):
223225
dense_features = self._convert_n_to_tensor(examples['dense_features'])
224226
dense_variables = self._convert_n_to_tensor(self._variables[
225227
'dense_features_weights'])
226-
for i in xrange(len(dense_variables)):
228+
for i in range(len(dense_variables)):
227229
predictions += dense_features[i] * dense_variables[i]
228230
return predictions
229231

tensorflow/core/framework/allocator.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,14 @@ class Allocator {
187187

188188
// is_simple<T>::value if T[] can be safely constructed and destructed
189189
// without running T() and ~T(). We do not use std::is_trivial<T>
190-
// directly because std::complex<float> is not trival but its array
191-
// can be constructed and destructed without running its default ctor
192-
// and dtor.
190+
// directly because std::complex<float> and std::complex<double> are
191+
// not trival, but their arrays can be constructed and destructed
192+
// without running their default ctors and dtors.
193193
template <typename T>
194194
struct is_simple {
195195
static const bool value = std::is_trivial<T>::value ||
196196
std::is_same<T, complex64>::value ||
197+
std::is_same<T, complex128>::value ||
197198
is_quantized<T>::value;
198199
};
199200

tensorflow/core/framework/node_def_util_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ TEST(NodeDefUtilTest, Out) {
151151
ExpectFailure(bad, op,
152152
"Value for attr 'T' of string is not in the list of allowed "
153153
"values: float, double, int64, int32, uint8, uint16, int16, "
154-
"int8, complex64, qint8, quint8, qint32");
154+
"int8, complex64, complex128, qint8, quint8, qint32");
155155
}
156156

157157
TEST(NodeDefUtilTest, Enum) {

tensorflow/core/framework/numeric_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ namespace tensorflow {
2424

2525
// Single precision complex.
2626
typedef std::complex<float> complex64;
27+
// Double precision complex.
28+
typedef std::complex<double> complex128;
2729

2830
} // end namespace tensorflow
2931

tensorflow/core/framework/op_def_builder_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ TEST_F(OpDefBuilderTest, AttrWithRestrictions) {
113113
ExpectSuccess(b().Attr("a:numbertype"),
114114
"attr: { name: 'a' type: 'type' allowed_values { list { type: "
115115
"[DT_FLOAT, DT_DOUBLE, DT_INT64, DT_INT32, DT_UINT8, DT_INT16, "
116-
"DT_UINT16, DT_INT8, DT_COMPLEX64, DT_QINT8, DT_QUINT8, "
116+
"DT_UINT16, DT_INT8, DT_COMPLEX64, DT_COMPLEX128, DT_QINT8, DT_QUINT8, "
117117
"DT_QINT32] } } }");
118118
ExpectSuccess(b().Attr("a:realnumbertype"),
119119
"attr: { name: 'a' type: 'type' allowed_values { list { type: "

tensorflow/core/framework/op_def_util_test.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ TEST_F(ValidateOpDefTest, BadAttrAllowed) {
246246
TestBuilder(OpDefBuilder("BadAttrtude")
247247
.Attr("x: list(realnumbertype) = [DT_COMPLEX64]")),
248248
"attr 'x' of complex64 is not in the list of allowed values");
249+
ExpectFailure(
250+
TestBuilder(OpDefBuilder("BadAttrtude")
251+
.Attr("x: list(realnumbertype) = [DT_COMPLEX128]")),
252+
"attr 'x' of complex128 is not in the list of allowed values");
249253
// Is in list of allowed strings.
250254
TF_EXPECT_OK(TestBuilder(
251255
OpDefBuilder("GoodAttrtude").Attr("x: {'foo', 'bar'} = 'bar'")));

tensorflow/core/framework/register_types.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ limitations under the License.
6363
m(int16); \
6464
m(int8)
6565

66-
// Call "m" for all number types, including complex64.
66+
// Call "m" for all number types, including complex64 and complex128.
6767
#define TF_CALL_NUMBER_TYPES(m) \
6868
TF_CALL_REAL_NUMBER_TYPES(m); \
69-
m(complex64)
69+
m(complex64); \
70+
m(complex128)
7071

7172
#define TF_CALL_NUMBER_TYPES_NO_INT32(m) \
7273
TF_CALL_REAL_NUMBER_TYPES_NO_INT32(m); \
73-
m(complex64)
74+
m(complex64); \
75+
m(complex128)
7476

7577
#define TF_CALL_POD_TYPES(m) \
7678
TF_CALL_NUMBER_TYPES(m); \

0 commit comments

Comments
 (0)