{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# QAT(resnet18)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import torch\n", "import torch.nn as nn\n", "import torchvision\n", "import torch.quantization\n", "import torch.quantization._numeric_suite as ns\n", "from torch.quantization import (\n", " default_eval_fn,\n", " default_qconfig,\n", " quantize,\n", ")\n", "\n", "# 设置 warnings\n", "import warnings\n", "warnings.filterwarnings(\n", " action='ignore',\n", " category=DeprecationWarning,\n", " module='.*'\n", ")\n", "warnings.filterwarnings(\n", " action='default',\n", " module='torch.quantization'\n", ")\n", "warnings.filterwarnings(\n", " action='default',\n", " module='torch.ao.quantization'\n", ")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "interpreter": { "hash": "61447c3ddb95e77cf825d46d6f70227c36ed08aec1baab023b2c78b109ed3829" }, "kernelspec": { "display_name": "Python 3.9.7 ('ai')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.0" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }