{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# For tips on running notebooks in Google Colab, see\n# https://codelin.vip/beginner/colab\n%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "(beta) Utilizing Torch Function modes with torch.compile\n========================================================\n\n**Author:** [Michael Lazos](https://github.com/mlazos)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This recipe covers how to use a key torch extensibility point,\n\n: torch function modes, in tandem with `torch.compile` to override the\n behavior of torch operators, also know as **ops**, at trace time,\n with no runtime overhead.\n\n```{=html}\n
This recipe requires PyTorch 2.7.0 or later.
\n```\n```{=html}\n