22 Commits

Author SHA1 Message Date
Peter Hawkins
319ab98980 Apply pyupgrade --py39-plus.
Notable changes:
* use PEP 585 type names
* use PEP 604 type union syntax where `from __future__ import annotations` is present.
* use f-strings in more places.
* remove redundant arguments to open().
2023-07-21 14:49:44 -04:00
George Necula
9261edaf94 [shape_poly] Cleanups for the shape polymorphism APIs.
Shape polymorphism relies on a number of functions defined
in core.py. Overtime we have accumulated some duplicate functionality
in those functions. Here we do some cleanups:

  * remove symbolic_equal_dim and symbolic_equal_shape in favor of the
    newer definitely_equal and definitely_equal_shape
  * remove is_special_dim_size, which checks that a value is a
    dimension expression (not a constant). Some uses are replaced
    with `not is_constant_dim` and others with `is_dim`.
  * introduce concrete_dim_or_error to check that a value is
    a dimension
2023-06-30 15:56:57 +03:00
vfdev
d875942a69
Typo fix in ResizeMethod docstring, scale.py 2023-03-20 23:10:51 +01:00
Jake VanderPlas
760deb310e Remove leading underscores in jax._src.numpy.util 2023-03-13 12:18:36 -07:00
Roy Frostig
cb8dcce2fe migrate more internal dependencies from jax.core to jax._src.core
PiperOrigin-RevId: 509736368
2023-02-14 23:01:11 -08:00
Peter Hawkins
ba557d5e1b Change JAX's copyright attribution from "Google LLC" to "The JAX Authors.".
See https://opensource.google/documentation/reference/releasing/contributions#copyright for more details.

PiperOrigin-RevId: 476167538
2022-09-22 12:27:19 -07:00
Jake VanderPlas
c1729a116b [x64] make image_test compatible with strict dtype promotion 2022-06-15 11:41:23 -07:00
jax authors
f8cddf0eca Merge pull request #9689 from fehiepsi:image
PiperOrigin-RevId: 438282642
2022-03-30 06:05:30 -07:00
Peter Hawkins
80aec7b25f Documentation improvements. 2022-03-08 09:37:33 -05:00
Du Phan
0b022b71a5 Fix incorrect implementation to find canonicalize_axis 2022-02-25 21:48:39 -05:00
Du Phan
0a859453b3 Use canonicalize_axis 2022-02-25 17:39:47 -05:00
Du Phan
e28ec78d7a Make negative dimension return consistent results for image.scale_and_translate 2022-02-24 22:34:00 -05:00
George Necula
3715fcb930 Added workaround for bug in XLA 2021-11-18 11:01:50 +02:00
George Necula
75155f5eda [shape_poly] Refactor arange and image_resize for shape polymorphism
Bug: 8367

Small refactoring to jax.image.resize to make it compatible with
shape polymorphismin jax2tf. In the process added also support for
jnp.arange([dim_poly]). Note that the underlying lax.iota already
supported shape polymorphism.
2021-11-18 10:27:32 +02:00
Peter Hawkins
a163b6ec5d [JAX] Canonicalize shapes in jax.image.resize().
This makes jax.image.resize() robust to having jnp arrays passed as sizes. It also turns out some users were passing floating point values here, and this means they are correctly flagged as errors.

PiperOrigin-RevId: 399996702
2021-09-30 12:38:39 -07:00
Jake VanderPlas
62d9223fe8 jax.image: fix error with zero-size image resizing 2021-08-11 11:20:20 -07:00
Peter Hawkins
b232d09440 Enable flake8 checks for spaces around operators. 2021-07-30 08:45:38 -04:00
Luke Pfister
9f61f41e47 prevent nans in _fill_lanczos_kernel 2021-05-20 21:49:41 -06:00
Luke Pfister
bcd5deb269 Prevent nans in scale_and_translate
fixes #6780
2021-05-18 15:36:45 -06:00
Jake VanderPlas
af6da229da DOC: fix some minor formatting issues 2021-01-28 15:20:02 -08:00
Jake VanderPlas
f74235cdae X32 tests: fail on dtype warnings 2020-12-08 13:03:30 -08:00
Peter Hawkins
c876efcc2c Move implementation of jax.image to jax._src.image. 2020-10-17 11:37:55 -04:00