[pull] master from tensorflow:master - #8797
Merged
Merged
Conversation
`_scalar` was fixed to call `math_ops.cast` because `Tensor` only has an
`astype` method after `enable_numpy_methods_on_tensor()` has run. Five
more `astype` calls, in four other functions, still fail without that
opt-in, which is what a plain `import tensorflow` gives you:
>>> tnp.around([1.5, 2.5])
AttributeError: EagerTensor object has no attribute 'astype'.
`around` casts back to the argument's dtype on every path, so it fails on
any input, taking `tnp.round` and `Tensor.__round__` with it. `heaviside`
and `average` fail on integer input, `_with_index_update_helper` on any.
`astype` is installed as an alias of `math_ops.cast`, so calling `cast`
directly is the same operation without the dependency on the opt-in.
Neither module calls `astype` after this change.
The regression tests go in the module added for the `_scalar` fix, plus an
`np_array_ops` counterpart. Both deliberately skip the opt-in, which is
what makes these paths observable in a test.
The `_with_index_*` methods are attached to `Tensor` as `functools.partial` objects, and `functools.partial` became a descriptor in Python 3.13. On 3.13 and later it binds the tensor as the helper's first argument; before 3.13 it does not, so the tensor has to be passed explicitly. Reaching the helper through the method therefore needs opposite call sites on either side of that version boundary, and TensorFlow builds against both. Call `_with_index_update_helper` directly instead. That is the function this change fixes, and it takes the same arguments on every supported version.
…aused by map reallocation. In ConstraintPropagator::PropagateFusionBoundary, copying ConstraintState objects by value before mutating states_ prevents use-after-free reads when absl::flat_hash_map rehashes during insertion. PiperOrigin-RevId: 974180232
PiperOrigin-RevId: 974180531
…rter - Enable PropagateQParamsPass, BiasQuantizerPass, and FuseQDQPass in the StableHLO pipeline. - Inline private functions and run symbol DCE prior to lowering quant annotations. - Add CleanupOptimizationBarrierPass and ReconcileUnrealizedCastsPass to the optimization pipeline. - Update PostQuantizePass and FuseQDQPass to support resource constants and per-axis quantization. - Add test coverage for post-quantization optimization passes in optimize-after-quantization.mlir. PiperOrigin-RevId: 974194477
…r builds. Under sanitizers (ASan, TSan, MSan, HWASan), multi-threaded CPU execution and JIT compilation incur significant overhead, which can cause collective call rendezvous to exceed the default 40-second timeout. Scale CPU collective call timeouts by 10x in sanitizer builds to prevent flakiness. PiperOrigin-RevId: 974216046
…ining-callsites PiperOrigin-RevId: 974247978
PiperOrigin-RevId: 974283733
PiperOrigin-RevId: 974284429
PiperOrigin-RevId: 974287919
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )