Change normalize to make it export friendly
As titled. torch.export doesn't work with _get_kernel since it looks into attributes of a class. Here we are assigning a kernel manually for torch.export.
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8511
- :page_facing_up: Preview Python docs built from this PR
Note: Links to docs will display an error until the docs builds have been completed.
:x: 16 New Failures, 3 Unrelated Failures
As of commit 7666e938cf2a198eb23d4b360a3c74df8a0dfa1f with merge base bf01bab6125c5f1152e4f336b470399e52a8559d ():
NEW FAILURES - The following jobs have failed:
-
Build Linux Wheels / pytorch/vision / upload / manywheel-py3_8-rocm6_0 (gh)
Unable to find an artifact with the name: pytorch_vision__3.8_rocm6.0_x86_64 -
Lint / python-types / linux-job (gh)
RuntimeError: Command docker exec -t dd1f2a36a7c178b741999f233189f3fcd9ccdf9a9c6911ed463d5e21bfdaebe6 /exec failed with exit code 1 -
Tests / unittests-linux (3.10, linux.12xlarge, cpu) / linux-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-linux (3.11, linux.12xlarge, cpu) / linux-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-linux (3.12, linux.12xlarge, cpu) / linux-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-linux (3.8, linux.12xlarge, cpu) / linux-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-linux (3.8, linux.g5.4xlarge.nvidia.gpu, cuda, 11.8) / linux-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cuda-dtype1-make_video] -
Tests / unittests-linux (3.9, linux.12xlarge, cpu) / linux-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-macos (3.10, macos-m1-stable) / macos-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-macos (3.11, macos-m1-stable) / macos-job (gh)
AttributeError: '_OpNamespace' 'image' object has no attribute '_jpeg_version' -
Tests / unittests-macos (3.12, macos-m1-stable) / macos-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-macos (3.8, macos-m1-stable) / macos-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-macos (3.9, macos-m1-stable) / macos-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-windows (3.12, windows.4xlarge, cpu) / windows-job (gh)
Process completed with exit code 2. -
Tests / unittests-windows (3.8, windows.4xlarge, cpu) / windows-job (gh)
test/test_transforms_v2.py::TestLinearTransform::test_transform[cpu-dtype1-make_video] -
Tests / unittests-windows (3.8, windows.g5.4xlarge.nvidia.gpu, cuda, 11.8) / windows-job (gh)
Process completed with exit code 1.
BROKEN TRUNK - The following jobs failed but were present on the merge base:
👉 Rebase onto the `viable/strict` branch to avoid these failures
-
Tests / unittests-windows (3.10, windows.4xlarge, cpu) / windows-job (gh) (trunk failure)
Process completed with exit code 2. -
Tests / unittests-windows (3.11, windows.4xlarge, cpu) / windows-job (gh) (trunk failure)
Process completed with exit code 2. -
Tests / unittests-windows (3.9, windows.4xlarge, cpu) / windows-job (gh) (trunk failure)
Process completed with exit code 2.
This comment was automatically generated by Dr. CI and updates every 15 minutes.
Thanks for the PR @larryliu0820 and sorry for the late reply, I was away last week.
Support for torch.export is still an ongoing effort for the v2 transforms and we still lack a bit of clarity on that front. Can you please share a snippet of what you're trying to enable exactly? E.g. are you trying to export the class? The functional? The kernel? FYI, earlier this year I summarized what is currently supported by torchvision in terms of compile/export (internal link).