Skip to content

Add ImageType support for graph inputs and outputs - #136

Merged
gokulkrishna98 merged 5 commits into
apple:mainfrom
gokulkrishna98:dev/gokul/image_type_support
Oct 22, 2026
Merged

gokulkrishna98 merged 5 commits into
apple:mainfrom
gokulkrishna98:dev/gokul/image_type_support

Conversation

@gokulkrishna98

Copy link
Copy Markdown
Contributor

Adds input_image_types / output_image_types to add_exported_program and add_pytorch_module, mapping IO names to coreai.authoring.ImageType.

  • Listed inputs become !coreai.image graph arguments converted with coreai.image_to_tensor; listed outputs are converted with coreai.tensor_to_image. Unlisted IO stays tensors.
  • Unknown names, state IO, and tensor shape/dtype mismatches raise clear errors.
  • Tests in tests/test_image_io.py; docs in docs/api/TorchConverter.md (Image IO section).

gokulkrishna98 and others added 5 commits October 20, 2026 12:57
add_exported_program and add_pytorch_module accept input_image_types and
output_image_types, mapping IO names to coreai.authoring.ImageType. Listed
inputs become !coreai.image arguments converted with image_to_tensor; listed
outputs are converted with tensor_to_image. Unlisted IO stays tensors.
@gokulkrishna98
gokulkrishna98 marked this pull request as ready for review October 21, 2026 22:38
@gokulkrishna98
gokulkrishna98 merged commit a202025 into apple:main Oct 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants