NaNs no longer break comparisons, so it's safe to test them now. I also want to
put a NaN into the default set of inputs eventually, but right now that
uncovers some bugs in both Eigen and generated kernels.
PiperOrigin-RevId: 356473399
Change-Id: I2d39f0906ccbcbabb8d0bef48e0d23f6f58da620
The default behavior is that NaN != NaN, making it impossible to check
values against known good values that contains NaN. Change the behavior
so NaN is equal (and close) to just NaN. While this is incompatible with
IEEE 754, it makes writing tests much easier.
PiperOrigin-RevId: 356463179
Change-Id: Iad2bd77708eb21e86398413425f77423442de5ad
Use Find<module>.cmake instead of <module>config.cmake to remove absl_DIR hack.
PiperOrigin-RevId: 356438974
Change-Id: I5de67e21c2e55cad20ce3da002260acdd98c06b3
Attempting to do so without this change raises an exception:
```
File ".../tensorflow/python/ops/check_ops.py", line 672, in assert_equal
data, summarize, message, name)
File ".../tensorflow/python/ops/check_ops.py", line 369, in _binary_assert
x_static = tensor_util.constant_value(x)
File ".../tensorflow/python/framework/tensor_util.py", line 876, in constant_value
ret = _ConstantValue(tensor, partial)
File ".../tensorflow/python/framework/tensor_util.py", line 681, in _ConstantValue
return MakeNdarray(tensor.op.get_attr("value"))
File ".../tensorflow/python/framework/tensor_util.py", line 641, in MakeNdarray
raise TypeError("Unsupported tensor type: %s" % tensor.dtype)
TypeError: Unsupported tensor type: 23
```
PiperOrigin-RevId: 356437863
Change-Id: I51d9adf8727bcf01ac3a862a608fa93e2cb6a88d
For synthetic kernel tests, use the tensor index # as the tensor name to
simplify debugging.
PiperOrigin-RevId: 356411736
Change-Id: Id43f80f8d2416437e271bc3f72f5db42424a677a
- This cl instructs dynamic padder to insert implicit broadcasts into the graph when a binary operation is performed on two dynamic tensors.
- Optimization #1: The implicit broadcast is only inserted when we can't proof two dynamic dimensions are the same.
- Optimization #2: Added a simplification pass that allows us to simplify operations on dynamic dimensions, this opens up more opportunities for optimization #1
PiperOrigin-RevId: 356407626
Change-Id: I980477ee6f3ccb42342226afaab03b4b09549360
For synthetic kernel tests, use the tensor index # as the tensor name to
simplify debugging.
PiperOrigin-RevId: 356391830
Change-Id: I0f52876c2080a68574b550cfb8ec90cf3c776a7a
MaybeImproveInstructionSharding() already checks that it needs to be compatible with existing tiled sharding (if any).
PiperOrigin-RevId: 356375771
Change-Id: Ic5e65e00cea0a25cec2cf93027632c4c7783a20e
Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/46195
Add build terget on Sony Spresense board.
To build it, Spresense SDK is required.
And hello_world, micro_speech and preson_detection are added for the board.
The related issue is #46240
Copybara import of the project:
--
bff4913f03be75a368c6845c448fdd2fe5624bb1 by Takayoshi Koizumi <takayoshi.koizumi@gmail.com>:
Add Sony Spresense board target
Add build terget on Sony Spresense board.
To build it, Spresense SDK is required.
And hello_world, micro_speech and preson_detection are added for the
board.
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/tensorflow/pull/46195 from takayoshi-k:add_spresense_target bff4913f03be75a368c6845c448fdd2fe5624bb1
PiperOrigin-RevId: 356357681
Change-Id: I4b62059ef27b47775431168536da563a56343a6d
The pattern is common is TF python library like height = tf.shape(x)[1].
When x has some dynamic dimensions (typically batch dim), tf.shape can not be constant folded so height cannot be inferred as a constant.
This PR folds this kind of patterns to improve sub-shape constant folding.
Rename some testcases
Correctly handle negative strides
Add testcases for out of bound begin and end
clang-format
Address comments
Fix Windows build. Templated Lambda is not supported in MSVC.
Fix shrink_axis_mask with negative begin
Use canonicalization pattern instead of folder to better support unranked and dynamic output
Switch back to folder
- Extend this check from AllGather to all other instruction that have use_global_device_ids
PiperOrigin-RevId: 356318717
Change-Id: Ib5397454eed6f212e71e0aab45f52ad83e870715
The loop is comparing every elements to the first one in the range, we can drop_front()
from the range since the first element does not need to compare to iself.
PiperOrigin-RevId: 356317270
Change-Id: Ieb54a4308e86bf9b510d81fa7bc46a32a361589c