pytorch-metric-learning breaking changes
Updated December 4, 2026
On this page
Latest version 3.0.5, released December 4, 2026. Source repository
Its 3.0.0 release requires Python 3.12 or later. Python end of life dates.
- From 2.0.0 to 3.0.0: 489 breaking changes in 6 versions.
- From 1.0.0 to 3.0.0: 547 breaking changes in 7 versions.
pytorch-metric-learning 3.0.0 breaking changes
- Removed
Version 3 requires Python 3.12 or newer, so older interpreters can no longer run the package. kevinmusgrave.github.io - Removed
The with-hooks extra and its record-keeper and TensorBoard integration were removed. kevinmusgrave.github.io - Removed
AccuracyCalculator.get_curr_metrics
Read the metrics attribute instead, which is a tuple of the selected metric names. kevinmusgrave.github.io - Removed
datasets.Cars196
Build the Cars196 dataset in application code and preserve the published split. kevinmusgrave.github.io - Removed
datasets.CUB
Build the CUB-200-2011 dataset in application code and preserve the published split. kevinmusgrave.github.io - Removed
InferenceModel
Write the equivalent inference code directly with PyTorch. github.com - Removed
LpRegularizer
Passing distance to LpRegularizer now raises TypeError; remove the argument. kevinmusgrave.github.io - Removed
P2SGradLoss
Passing distance to P2SGradLoss now raises TypeError, so remove the argument. kevinmusgrave.github.io - Removed
pytorch_metric_learning.__version__
Read the installed version with importlib.metadata.version instead of __version__. pypi.org - Removed
pytorch_metric_learning.datasets
The datasets package is gone; load data with your own PyTorch code. pypi.org - Removed
pytorch_metric_learning.distances.base_distance.ModuleWithRecords
pytorch_metric_learning.distances.base_distance.ModuleWithRecords was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.distances.BaseDistance.add_to_recordable_attributes
BaseDistance.add_to_recordable_attributes was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.distances.BaseDistance.collect_stats
BaseDistance.collect_stats was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.distances.BaseDistance.largest_dist
BaseDistance.largest_dist was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.distances.BaseDistance.reset_stats
BaseDistance.reset_stats was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.distances.BaseDistance.set_default_stats
BaseDistance.set_default_stats was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.distances.BaseDistance.smallest_dist
BaseDistance.smallest_dist was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.distances.BatchedDistance.__getattr__
BatchedDistance.__getattr__ was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.distances.BatchedDistance.iter_fn
BatchedDistance.iter_fn was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.distances.lp_distance.lmu
pytorch_metric_learning.distances.lp_distance.lmu was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.angular_loss.c_f
pytorch_metric_learning.losses.angular_loss.c_f was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.angular_loss.lmu
pytorch_metric_learning.losses.angular_loss.lmu was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.AngularLoss.get_pairs
AngularLoss.get_pairs was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.AngularLoss.set_stats
Diagnostics must now be computed in caller code because the loss no longer records statistics. pypi.org - Removed
pytorch_metric_learning.losses.arcface_loss.c_f
pytorch_metric_learning.losses.arcface_loss.c_f was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.arcface_loss.LargeMarginSoftmaxLoss
pytorch_metric_learning.losses.arcface_loss.LargeMarginSoftmaxLoss was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.ArcFaceLoss.get_cos_with_margin
ArcFaceLoss.get_cos_with_margin was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.base_loss_wrapper
pytorch_metric_learning.losses.base_loss_wrapper was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.base_metric_loss_function.c_f
pytorch_metric_learning.losses.base_metric_loss_function.c_f was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.base_metric_loss_function.ModuleWithRecordsReducerAndDistance
pytorch_metric_learning.losses.base_metric_loss_function.ModuleWithRecordsReducerAndDistance was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseLossWrapper
pytorch_metric_learning.losses.BaseLossWrapper was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.add_embedding_regularization_to_loss_dict
BaseMetricLossFunction.add_embedding_regularization_to_loss_dict was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.add_to_recordable_attributes
BaseMetricLossFunction.add_to_recordable_attributes was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.all_regularization_loss_names
BaseMetricLossFunction.all_regularization_loss_names was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.collect_stats
BaseMetricLossFunction.collect_stats was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.embedding_regularization_loss
BaseMetricLossFunction.embedding_regularization_loss was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.get_default_distance
BaseMetricLossFunction.get_default_distance was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.get_default_reducer
BaseMetricLossFunction.get_default_reducer was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.regularization_loss_names
BaseMetricLossFunction.regularization_loss_names was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.reset_stats
BaseMetricLossFunction.reset_stats was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.set_reducer
BaseMetricLossFunction.set_reducer was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.sub_loss_names
BaseMetricLossFunction.sub_loss_names was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.zero_loss
BaseMetricLossFunction.zero_loss was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.BaseMetricLossFunction.zero_losses
BaseMetricLossFunction.zero_losses was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.circle_loss.c_f
pytorch_metric_learning.losses.circle_loss.c_f was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.circle_loss.lmu
pytorch_metric_learning.losses.circle_loss.lmu was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.CircleLoss.delta_n
CircleLoss.delta_n was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.CircleLoss.delta_p
CircleLoss.delta_p was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.CircleLoss.m
CircleLoss.m was removed in pytorch-metric-learning 3.0.0 pypi.org - Removed
pytorch_metric_learning.losses.CircleLoss.on
CircleLoss.on was removed in pytorch-metric-learning 3.0.0 pypi.org
And 395 more in this version. Sign up to see every change
pytorch-metric-learning 3.0.0rc5 breaking changes
- Removed
losses.CentroidTripletLoss.swap
The rewritten CentroidTripletLoss no longer accepts swap; remove it from calls. github.com - Removed
losses.CentroidTripletLoss.triplets_per_anchor
The rewritten CentroidTripletLoss no longer accepts triplets_per_anchor; remove it from calls. github.com - Behavior changed
ManifoldLoss
ManifoldLoss now raises TypeError when given a distance that is not a similarity; use a similarity distance. github.com - Default changed
losses.CentroidTripletLoss
The default distance changed to the paper's squared Euclidean distance, so results differ from earlier versions unless you pass a distance explicitly. github.com
pytorch-metric-learning 3.0.0rc4 breaking changes
- Behavior changed
RetrievalInputs
Code that constructs RetrievalInputs directly must supply reference_labels and ref_includes_query. github.com
pytorch-metric-learning 3.0.0rc3 breaking changes
- Default changed
DotProductSimilarity
DotProductSimilarity now computes a plain dot product; pass normalize_embeddings=True for the previous behavior. github.com - Default changed
TripletMarginLoss
The default margin is now 0.2; pass margin=0.05 for the previous default. github.com
pytorch-metric-learning 3.0.0rc2 breaking changes
- Behavior changed
CrossBatchMemory4MultiLabel
Use CrossBatchMemory with label_shape and pair_function instead. github.com - Default changed
TupletMarginLoss
Endpoint angles now have zero angular gradient at nonzero margin. github.com - Signature changed
pytorch_metric_learning.losses.LargeMarginSoftmaxLoss.modify_cosine_of_target_classes
Subclasses of ArcFaceLoss, CosFaceLoss and LargeMarginSoftmaxLoss now get labels as a second argument. pypi.org
pytorch-metric-learning 3.0.0rc1 breaking changes
- Removed
AccuracyCalculator.metric_functions
metric_functions, requires_knn, requires_clustering, aggregate and the calculate_* methods are removed. github.com - Removed
collect_stats
Compute diagnostics from returned tensors or forward hooks instead. github.com - Removed
InferenceModel
Training and evaluation orchestration is removed; use the equivalent PyTorch code shown in the recipes. github.com - Removed
pytorch_metric_learning.miners.HDCMiner.set_idx_externally
Pass candidate tuples through the indices_tuple argument of forward instead. pypi.org - Removed
pytorch_metric_learning.python
The package requires Python 3.12 or newer. github.com - Removed
pytorch_metric_learning.utils.accuracy_calculator
Retrieval metrics and backends now live in pytorch_metric_learning.evaluation. pypi.org - Removed
pytorch_metric_learning.utils.loss_and_miner_utils
Use utils.indexing instead; everything else under utils is private. pypi.org - Removed
sub_loss_names
Custom losses no longer use these attributes. github.com - Renamed
AngularMiner
Pass alpha=... instead of angle. github.com - Renamed
CircleLoss
Pass margin=... instead of m. github.com
And 24 more in this version. Sign up to see every change
Older versions
2 older versions, each with its first changes. Sign up to see every change
Show 2 older versions
pytorch-metric-learning 2.0.0 breaking changes
- Removed
pytorch_metric_learning.distances.BaseDistance.set_stats
BaseDistance.set_stats was removed in pytorch-metric-learning 2.0.0 pypi.org - Removed
pytorch_metric_learning.losses.centroid_triplet_loss
pytorch_metric_learning.losses.centroid_triplet_loss was removed in pytorch-metric-learning 2.0.0 pypi.org
And 56 more in this version.
pytorch-metric-learning 1.0.0 breaking changes
- Removed
pytorch_metric_learning.losses.CrossBatchMemory.embedding_memory
CrossBatchMemory.embedding_memory was removed in pytorch-metric-learning 1.0.0 pypi.org - Removed
pytorch_metric_learning.losses.CrossBatchMemory.has_been_filled
CrossBatchMemory.has_been_filled was removed in pytorch-metric-learning 1.0.0 pypi.org
And 48 more in this version.
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.