diff options
author | 2016-05-16 21:53:07 -0800 | |
---|---|---|
committer | 2016-05-16 23:02:16 -0700 | |
commit | b2417e1e498b88543de0e7a1091d04924f2f9afd (patch) | |
tree | abd5d2d7878cf1ad8f11de59be1990bfa6e5086d /tensorflow/python/ops/op_def_library_test.py | |
parent | 0160bda1a9d6bc56d8136fe25caa7cf269cea605 (diff) |
Implements automatic packing for nested lists/tuples of tensors.
This change extends the set of valid arguments to
`tf.convert_to_tensor()` to include lists/tuples that contain a
mixture of values and `tf.Tensor` objects.
This enables you to write things like:
```python
input_data = ...
batch_size = tf.placeholder(tf.int32, shape=[])
reshaped_data = tf.reshape(input_data, [batch_size, 784])
```
...and saves you from having to use `tf.concat()`/`tf.pack()` to
achieve this manually.
Fixes #2328.
Change: 122494369
Diffstat (limited to 'tensorflow/python/ops/op_def_library_test.py')
-rw-r--r-- | tensorflow/python/ops/op_def_library_test.py | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/tensorflow/python/ops/op_def_library_test.py b/tensorflow/python/ops/op_def_library_test.py index 22d14e2789..8b712a61db 100644 --- a/tensorflow/python/ops/op_def_library_test.py +++ b/tensorflow/python/ops/op_def_library_test.py @@ -221,12 +221,6 @@ class OpDefLibraryTest(test_util.TensorFlowTestCase): self._lib.apply_op("Simple", wrong=7) self.assertEqual(str(cm.exception), "No argument for input a") - with self.assertRaises(TypeError) as cm: - self._lib.apply_op("Simple", a=[self.Tensor(dtypes.int32)]) - self.assertStartsWith(str(cm.exception), - "Expected int32, got list containing Tensors of type " - "'_Message' instead.") - def testReservedInput(self): self._add_op("name: 'ReservedInput' " "input_arg { name: 'input' type: DT_INT32 } ") @@ -267,11 +261,6 @@ class OpDefLibraryTest(test_util.TensorFlowTestCase): self.assertEqual(str(cm.exception), "Should not specify value for inferred attr 'T'.") - with self.assertRaises(TypeError) as cm: - self._lib.apply_op("Polymorphic", a=[self.Tensor(dtypes.bool)]) - self.assertEqual(str(cm.exception), - "List of Tensors when single Tensor expected") - def testPolymorphicOut(self): self._add_op("name: 'PolymorphicOut' " "output_arg { name: 'out' type_attr: 'T' } " |