unstale

pypi / tensorflow

tensorflow

What changed in tensorflow 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

77 breaking2 security20 deprecations68 new APIs and options2 performance17 behavior and defaults1 tooling4 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

tensorflow 2125 changes

Breaking changes 41

  • Support for Python 3.9 has been removed, so developers must use a supported Python version.

    2.21.0release notes

  • The TensorBoard dependency has been removed from TensorFlow.

    2.21.0release notes

  • Removed as a public API; use GradientTape to compute gradients.

    2.0.0release notes

  • Call build() to optimize TensorRT engines during graph optimization, replacing the prior is_dynamic_op=False approach.

    2.0.0release notes

  • Removed; provide calibration_input_fn to converter.convert() to trigger calibration.

    2.0.0release notes

  • No longer returns a tf.function; access the function from the saved model.

    2.0.0release notes

  • The negate sign is removed from cosine similarity in the loss.

    2.0.0release notes

  • DType is no longer convertible to an int; use dtype.as_datatype_enum to get the same result.

    2.0.0release notes

  • Renamed to export_saved_model.

    2.0.0release notes

  • Set experimental_run_tf_function=False in compile to unblock use cases affected by the unified Keras execution path.

    2.0.0release notes

  • The command-line tool was removed; use SavedModel instead of frozen graphs.

    2.0.0release notes

  • The default for gradient accumulation for TPU embeddings is now true.

    2.0.0release notes

  • Use GradientTape to compute gradients in place of the removed public compute_gradients API.

    2.0.0release notes

  • Now supports gradients for new resize kernels and uses proper pixel centers, with new kernels including anti-aliasing.

    2.0.0release notes

  • Canned Estimators no longer support this argument; use compat.v1 canned Estimators if needed.

    2.0.0release notes

  • The default Keras configuration no longer uses this environment variable to configure thread count; use tf.config.threading APIs.

    2.0.0release notes

  • ResourceVariable no longer accepts constraint in its constructor or exposes .constraint.

    2.0.0release notes

  • Tensors are no longer hashable and compare element-wise with == and !=; compat.v1.disable_tensor_equality restores the previous behavior.

    2.0.0release notes

  • Use this environment variable in place of the deprecated CUDA-related install path variables; it accepts comma-separated base paths.

    2.0.0release notes

  • Restore the previous Tensor equality behavior using this compatibility API.

    2.0.0release notes

  • Use the v1 estimator family to avoid the optimizer behavior change in the premade estimators.

    2.0.0release notes

  • Removed from tf.data.Options.

    2.0.0release notes

  • The default aggregation for canned Estimators is now SUM_OVER_BATCH_SIZE; pass SUM to retain the previous default behavior.

    2.0.0release notes

  • Premade estimators use Keras optimizers by default when optimizer is omitted or specified as a string; optimizer variables differ, making this checkpoint breaking.

    2.0.0release notes

  • Use shared_embeddings instead of shared_embedding_columns when working with v1 and v2 feature columns.

    2.0.0release notes

  • Global-variable helper methods are no longer needed in TensorFlow 2.0.

    2.0.0release notes

  • Set the default dtype to float64 with set_floatx if a model should not use the new float32 layer default.

    2.0.0release notes

  • Raises an error if batch_size is supplied when the input is a dataset, generator, or Keras sequence.

    2.0.0release notes

  • The default recurrent activation changed from hard_sigmoid to sigmoid; reset_after also defaults to True, enabling the unified CPU/GPU implementation and CuDNN compatibility.

    2.0.0release notes

  • Layers now default to float32 and automatically cast inputs to the layer dtype.

    2.0.0release notes

  • The norm_axis and params_axis arguments were replaced by axis.

    2.0.0release notes

  • Standardized the API by replacing norm_axis and params_axis with axis.

    2.0.0release notes

  • Losses are scaled in Keras compile/fit rather than in optimizers; custom training loops can use the new loss-scaling utilities.

    2.0.0release notes

  • Keras fit uses a unified execution path by default, converting inputs to Dataset and wrapping the training step in tf.function unless run_eagerly=True; some use cases retain fallback paths.

    2.0.0release notes

  • Saving now defaults to TensorFlow SavedModel format; HDF5 remains supported.

    2.0.0release notes

  • Training APIs raise ValueError if an integer is passed.

    2.0.0release notes

  • Use Keras optimizers in TensorFlow 2.0; canned Estimators also use them by default, which can make checkpoints incompatible with earlier optimizer variables.

    2.0.0release notes

  • For num greater than 1, the final value is now always stop.

    2.0.0release notes

  • Removed from the TensorFlow 2.0 Lite API.

    2.0.0release notes

  • Removed from the v2 API.

    2.0.0release notes

  • Added a TensorFlow 2.0-compatible API for TensorRT conversion using TrtConversionParams.

    2.0.0release notes

Security 2

  • Fixed an out-of-bounds access in the color palette when processing malformed GIF images.

    2.0.0release notes

  • Fixed a potential heap out-of-bounds vulnerability when decoding variant tensors from proto.

    2.0.0release notes

Deprecations 11

  • The TensorFlow 1.x API remains available through the compat.v1 module.

    2.0.0release notes

  • Deprecated; use TF_CUDA_PATHS instead.

    2.0.0release notes

  • SignatureDef utility functions are deprecated.

    2.0.0release notes

  • Deprecated; functionality has moved to core TensorFlow, ecosystem projects, or been removed.

    2.0.0release notes

  • Deprecated in favor of tf.keras.layers.DenseFeatures.

    2.0.0release notes

  • Deprecated; use tf.keras.models.save_model with save_format='tf' instead.

    2.0.0release notes

  • Deprecated; use tf.keras.models.load_model instead.

    2.0.0release notes

  • Use DenseFeatures in place of the deprecated tf.feature_column.input_layer.

    2.0.0release notes

  • Deprecated.

    2.0.0release notes

  • Use save_format='tf' to save in SavedModel format as the replacement for the deprecated experimental export API.

    2.0.0release notes

  • The traditional graph-building and Session execution model is discouraged in favor of regular Python functions.

    2.0.0release notes

New APIs and options 53

  • The NOT_EQUAL operator adds int16x8 support in tf.lite.

    2.21.0release notes

  • The SQRT operator adds int8 support in tf.lite.

    2.21.0release notes

  • The SQRT operator adds int16x8 support in tf.lite.

    2.21.0release notes

  • tf.data adds NoneTensorSpec to the public API so None values in element_spec can be identified with isinstance.

    2.21.0release notes

  • tfl.cast adds support for int2 and int4.

    2.21.0release notes

  • tf.lite adds support for the uint4 type.

    2.21.0release notes

  • Provide this argument to converter.convert() to trigger TensorRT calibration.

    2.0.0release notes

  • Added a CompositeTensor base class and support for CompositeTensors in TensorSpec and tf.function arguments.

    2.0.0release notes

  • Adds the adjoint operation to LinearOperator.

    2.0.0release notes

  • Adds H as an alias for the LinearOperator adjoint.

    2.0.0release notes

  • Added LinearOperatorHouseholder.

    2.0.0release notes

  • Added LinearOperatorToeplitz.

    2.0.0release notes

  • Added key and skip methods.

    2.0.0release notes

  • Adds an API for collecting graph and profile information.

    2.0.0release notes

  • TensorFlow now produces a tensorflow_core package containing the code and a tensorflow virtual package that forwards to it.

    2.0.0release notes

  • Set the build define to 0 to disable MKL-DNN contraction kernels.

    2.0.0release notes

  • Setting this environment variable to TRUE or 1 forces deterministic cuDNN convolution and max-pooling algorithms and deterministic algorithm selection.

    2.0.0release notes

  • Added compatibility support for restoring the previous Tensor equality behavior.

    2.0.0release notes

  • CriticalSection is exposed in core as tf.CriticalSection.

    2.0.0release notes

  • Added TensorArray support, RaggedTensor integration, cross-device user functions, and support for nested datasets in tensor creation, batching, and unbatching.

    2.0.0release notes

  • Set experimental_slack to True to introduce pipeline slack and reduce CPU contention.

    2.0.0release notes

  • Adds num_parallel_reads and support for passing a Dataset of filenames.

    2.0.0release notes

  • Disable v2 control flow with this toggle.

    2.0.0release notes

  • Added ellipsis (...) support.

    2.0.0release notes

  • Enable v2 control flow with this toggle.

    2.0.0release notes

  • Decorate regular Python functions to turn them into graphs that can be executed remotely, serialized, and optimized; CompositeTensor arguments receive basic support.

    2.0.0release notes

  • Added batch_dims support and corrected behavior when axis=None and batch_dims is negative.

    2.0.0release notes

  • Keras is the central high-level API for building and training models in TensorFlow 2.0, with eager execution and tf.data input pipelines.

    2.0.0release notes

  • Added as a public Keras backend API.

    2.0.0release notes

  • add_update can take a zero-argument callable, allowing updates to be disabled when a layer is non-trainable in eager training.

    2.0.0release notes

  • Preferred implementation for custom RNN cells in TensorFlow 2.0.

    2.0.0release notes

  • Added a dynamic constructor argument, which should be True when using imperative control flow in call.

    2.0.0release notes

  • Added implementation=3, which stores weights in a SparseTensor for faster large sparse models.

    2.0.0release notes

  • Added AUTO, NONE, SUM, and SUM_OVER_BATCH_SIZE loss reduction types; distribution-strategy contexts impose restrictions on their use.

    2.0.0release notes

  • Added v2 sparse categorical crossentropy metric and AUCCurve and AUCSummationMethod enums.

    2.0.0release notes

  • Added the tridiagonal multiplication operation.

    2.0.0release notes

  • Added the tridiagonal solve operation, a partial_pivoting input parameter, and a gradient.

    2.0.0release notes

  • Added a cumulative log-sum-exp operation.

    2.0.0release notes

  • Added the nextafter operation.

    2.0.0release notes

  • Utility to help scale losses in custom training loops.

    2.0.0release notes

  • Utility to help scale regularization losses in custom training loops.

    2.0.0release notes

  • Added boolean masking for ragged tensors.

    2.0.0release notes

  • Added stacking support for ragged tensors.

    2.0.0release notes

  • Added placeholder support for RaggedTensor.

    2.0.0release notes

  • Added a binomial random-number operation.

    2.0.0release notes

  • Added a utility to convert dense tensors to sparse tensors.

    2.0.0release notes

  • Added byte_split for string tensors.

    2.0.0release notes

  • Added a result_type parameter and support for inputs of any rank.

    2.0.0release notes

  • Added an unsorted segment join operation for strings.

    2.0.0release notes

  • Added branch selection based on a branch_index.

    2.0.0release notes

  • Wrap an optimizer class to enable automatic mixed-precision graph rewriting for float16 acceleration on Volta and Turing Tensor Cores.

    2.0.0release notes

  • Set TF2_BEHAVIOR=1 to enable v2 behavior, including v2 control flow.

    2.0.0release notes

  • Added Python API support, including from_saved_model, from_keras_file, and from_concrete_functions.

    2.0.0release notes

Behavior and default changes 14

  • The EQUAL operator adds int16x8 support in tf.lite.

    2.21.0release notes

  • tf.image.decode_image adds JPEG XL support.

    2.21.0release notes

  • tfl.fully_connected adds support for SRQ int2.

    2.21.0release notes

  • add_metric is now supported in graph function mode.

    2.0.0release notes

  • Turned on by default; disable when building with --define=tensorflow_mkldnn_contraction_kernel=0.

    2.0.0release notes

  • Emits StatelessIf when branch functions are stateless and do not touch resources; v2 control flow also accepts a one-element nonscalar predicate.

    2.0.0release notes

  • Promoted enumerate_dataset from the experimental API to the core Dataset API.

    2.0.0release notes

  • The cycle_length argument can now default to the number of schedulable CPU cores.

    2.0.0release notes

  • Promoted unbatch from the experimental API to the core Dataset API.

    2.0.0release notes

  • Now works in eager mode and supports callbacks.

    2.0.0release notes

  • Added broadcasting support.

    2.0.0release notes

  • Emits StatelessWhile when condition and body functions are stateless and do not touch resources.

    2.0.0release notes

  • The precision_mode argument is now case insensitive.

    2.0.0release notes

  • These losses now support both binary and -1/1 label input.

    2.0.0release notes

Tooling 1

  • Added support for the tflite_convert command-line tool in TensorFlow 2.0.

    2.0.0release notes

Fixes and other changes 3

  • tf.lite adds support for the int2 type.

    2.21.0release notes

  • tfl.slice adds support for int4.

    2.21.0release notes

  • Fixes callbacks not logging values in eager mode when used with a deferred build model.

    2.0.0release notes

tensorflow 166 changes

Breaking changes 36

  • Division follows Python flooring semantics, including tf.div; use tf.truncatediv for forced integer truncation.

    1.0.0release notes

  • Division and modulus operators follow Python flooring semantics.

    1.0.0release notes

  • Modulus follows Python flooring semantics, including tf.mod; use tf.truncatemod for forced integer truncation.

    1.0.0release notes

  • The Empty op is now stateful.

    1.0.0release notes

  • Several Python API calls change to resemble NumPy more closely; the release notes list specific API changes below.

    1.0.0release notes

  • Removed from the public API; use C++ shape function registration instead.

    1.0.0release notes

  • The argument order changes to labels, predictions, and named arguments are required.

    1.0.0release notes

  • The argument order changes to labels, predictions, and named arguments are required.

    1.0.0release notes

  • The argument order changes to labels, predictions, and named arguments are required.

    1.0.0release notes

  • Renamed to SparseTensor.dense_shape.

    1.0.0release notes

  • Renamed to SparseTensorValue.dense_shape.

    1.0.0release notes

  • The existing SyncReplicasOptimizer is removed; SyncReplicasOptimizerV2 is renamed to SyncReplicasOptimizer.

    1.0.0release notes

  • The var_scope property is renamed to variable_scope.

    1.0.0release notes

  • In the C++ API, Input, Output, and related types move from the tensorflow::ops namespace to tensorflow.

    1.0.0release notes

  • Moves to contrib/tensor_forest.

    1.0.0release notes

  • Replace with tf.summary.audio; summary ops now take name rather than tag as their first argument and respect name scopes.

    1.0.0release notes

  • Removed from the Python interface; use tf.abs, which supports complex tensors.

    1.0.0release notes

  • Arguments are reordered to match NumPy as values, axis, name.

    1.0.0release notes

  • TensorForestEstimator moves to contrib/tensor_forest.

    1.0.0release notes

  • Replace with tf.summary.histogram; summary ops now take name rather than tag as their first argument and respect name scopes.

    1.0.0release notes

  • Replace with tf.summary.image; summary ops now take name rather than tag as their first argument and respect name scopes.

    1.0.0release notes

  • Defaults to a faster DCT method with slightly reduced fidelity; set dct_method to INTEGER_ACCURATE to restore the old behavior.

    1.0.0release notes

  • Renamed to tf.reciprocal for component-wise reciprocal, avoiding confusion with matrix inversion.

    1.0.0release notes

  • Renamed to tf.setdiff1d to match NumPy naming.

    1.0.0release notes

  • Metrics weight broadcasting is stricter.

    1.0.0release notes

  • Most functions move temporarily to tf.contrib.rnn, except dynamic_rnn and raw_rnn.

    1.0.0release notes

  • RNN cell APIs move temporarily to tf.contrib.rnn; they are planned to move back into core for TF 1.1.

    1.0.0release notes

  • Now returns a callable that must be called with initializer arguments.

    1.0.0release notes

  • The second argument now takes indices of axes to reverse instead of a boolean mask.

    1.0.0release notes

  • Uses banker's rounding, or round-to-even semantics, to match NumPy.

    1.0.0release notes

  • Replace with tf.summary.scalar, whose first argument is name rather than tag and which respects TensorFlow name scopes.

    1.0.0release notes

  • Arguments are reordered to match NumPy as sp_input, num_split, axis; the function temporarily requires keyword arguments.

    1.0.0release notes

  • Arguments are reordered to match NumPy: value, num_or_size_splits, axis.

    1.0.0release notes

  • Replace with tf.summary.FileWriter.

    1.0.0release notes

  • Replace with tf.summary.FileWriterCache.

    1.0.0release notes

  • Now returns a callable that must be called with initializer arguments; update code to use tf.zeros_initializer().

    1.0.0release notes

Deprecations 9

  • Dimension arguments across the listed Python functions use axis in place of older keywords such as dimension, dim, and reduction_indices; old keywords remain temporarily for compatibility.

    1.0.0release notes

  • _ref dtypes are deprecated in the Python API.

    1.0.0release notes

  • Deprecated in favor of TensorArray.stack.

    1.0.0release notes

  • Deprecated in favor of TensorArray.unstack.

    1.0.0release notes

  • Deprecated in favor of tf.multiply.

    1.0.0release notes

  • Deprecated in favor of tf.negative.

    1.0.0release notes

  • Deprecated in favor of tf.stack.

    1.0.0release notes

  • Deprecated in favor of tf.subtract.

    1.0.0release notes

  • Deprecated in favor of tf.unstack.

    1.0.0release notes

New APIs and options 15

  • Adds a lookup table mapping indices to strings.

    1.0.0release notes

  • Accepts an optional custom_getter_ parameter.

    1.0.0release notes

  • A new op, parallel_stack, is added.

    1.0.0release notes

  • TensorFlow can now be installed with the standard pip install command.

    1.0.0release notes

  • Adds a feature column that transforms string features to IDs using a vocabulary file.

    1.0.0release notes

  • A new op is added for the StagingArea queue-like facility.

    1.0.0release notes

  • A new queue-like StagingArea and the stage and unstage ops are added.

    1.0.0release notes

  • Adds a lookup table mapping strings to indices.

    1.0.0release notes

  • Adds a convenience function to filter variable lists using regular expressions.

    1.0.0release notes

  • Adds image rotation for arbitrary angles.

    1.0.0release notes

  • Common compression option constants are introduced for RecordReader and RecordWriter.

    1.0.0release notes

  • saved_model is available through tf.saved_model.

    1.0.0release notes

  • Use tf.truncatediv to obtain forced integer truncation behavior.

    1.0.0release notes

  • Use tf.truncatemod to obtain forced integer truncation behavior.

    1.0.0release notes

  • TensorFlow Debugger adds a command-line interface and API.

    1.0.0release notes

Performance 2

Behavior and default changes 3

  • In-place update ops for strings are enabled on CPU.

    1.0.0release notes

  • tf.div remains available, but its semantics do not respond to Python 3 or from future mechanisms.

    1.0.0release notes

  • tf.divide is the recommended division function and now honors its name field.

    1.0.0release notes

Fixes and other changes 1

  • Supports restoring a session from v2 checkpoint files.

    1.0.0release notes