Skip to content

fail to import torchao.quantization.pt2e #3619

@shiyang-weng

Description

@shiyang-weng
import torch,torchao
import torchao.quantization.pt2e

There is following issue:

Traceback (most recent call last):
File "", line 1, in
import torchao.quantization.pt2e
File "/home/wengshiy/miniforge3/envs/aotest_without_t/lib/python3.14/site-packages/torchao/quantization/pt2e/init.py", line 94, in
ObserverOrFakeQuantize.module = "torchao.quantization.pt2e"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'typing.Union' object has no attribute 'module' and no dict for setting new attributes. Did you mean: 'reduce'?

My Env:
conda install python==3.14
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install --pre torchao --index-url https://download.pytorch.org/whl/nightly/cpu

Could you help check it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions