Skip to content

Shape Polymorphism, with an image downscale #15995

Answered by gnecula
thekevinscott asked this question in Q&A
Discussion options

You must be logged in to vote

At some level this is independent of jax2tf: dimensions must be integers. I.e., can you jit the function that you are trying to convert with jax2tf? You probably still want to use an integer and use h // 2 for downscaling. Once you start using division you are approaching the limits of the reasoning that shape polymorphism can do in terms of comparing dimension values. You may run into some errors that are specific to shape polymorphism. If you are prepared to ensure that you always will use this function on images with even height, then you can write 2 * height in lieu of height in the polymorphic shape specification.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@thekevinscott
Comment options

@gnecula
Comment options

@thekevinscott
Comment options

Answer selected by thekevinscott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants