# \[BC Breaking\] \`torch.export.export\_for\_inference()\` API is removed

**URL:** <https://dev-discuss.pytorch.org/t/bc-breaking-torch-export-export-for-inference-api-is-removed/2866>\
**Category:** deployment\
**Created:** [March 24, 2025, 6:13pm UTC](https://dev-discuss.pytorch.org/t/bc-breaking-torch-export-export-for-inference-api-is-removed/2866 "2025-03-24T18:13:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmagogsfm](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/gmagogsfm/32/66_2.png) [@gmagogsfm](https://dev-discuss.pytorch.org/u/gmagogsfm)\
**Post date:** [March 24, 2025, 6:13pm UTC](https://dev-discuss.pytorch.org/t/bc-breaking-torch-export-export-for-inference-api-is-removed/2866/1 "2025-03-24T18:13:45Z")

</div>

With this [PR](https://github.com/pytorch/pytorch/pull/149078), we removed an redundant API `torch.export.export_for_inference()`.

If you are using it and affected by this BC-breaking change, please replace your callsite in the following way

Before:

```auto
ep = export_for_inference(mod, args, kwargs, dynamic_shapes=dynamic_shape_spec, strict=strict_flag, preserve_module_call_signature=signature_spec, decomp_table=decomp_rules)

```

After:

```auto
ep = export_for_training(mod, args, kwargs, dynamic_shapes=dynamic_shape_spec, strict=strict_flag, preserve_module_call_signature=signature_spec)
ep = ep.run_decompositions(decomp_table=decomp_rules)

```
