Skip to content

Upgrading einops 0.7 to 0.8

Breaking0.7.0 → 0.8.2Breaking3Platform1New7Changed4Fixed7Other30

BreakingUpgrade verdict

3 breaking changes and a platform requirement change.

  • Deletes the chainer backend.
  • Deletes the experimental indexing module.
  • The TensorFlow layers were rewritten for newer TensorFlow and no longer work with older versions like TF 2.13.
  • You now need Python 3.9 or newer to use einops.
4 items need code or config changes

Python requirement changed in 0.8.2: >=3.8 → >=3.9.

Breaking3
Deletes the chainer backend.
Deletes the experimental indexing module.
einops.experimental.indexing
Updates TF layers to follow new instructions, compatible with TF 2.16 and not compatible with old TF such as TF 2.13.
Platform1
Changes the minimum supported Python version to 3.9 and updates Python versions in tests.

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • changed: function asnumpy(tensor) -> np_ndarray → function asnumpy(tensor: Tensor) -> np_ndarray
  • changed: function parse_shape(x, pattern: str) -> dict → function parse_shape(x: Tensor, pattern: str) -> dict
  • changed: function rearrange(tensor: Union[Tensor, List[Tensor]], pattern: str, **axes_lengths) -> Tensor → function rearrange(tensor: List[Tensor], pattern: str, **axes_lengths: Size) -> Tensor | (tensor: Tensor, pattern: str, **axes_lengths: Size) -> Tensor
  • changed: function reduce(tensor: Union[Tensor, List[Tensor]], pattern: str, reduction: Reduction, **axes_lengths: int) -> Tensor → function reduce(tensor: List[Tensor], pattern: str, reduction: Reduction, **axes_lengths: Size) -> Tensor | (tensor: Tensor, pattern: str, reduction: Reduction, **axes_lengths: Size) -> Tensor
  • changed: function repeat(tensor: Union[Tensor, List[Tensor]], pattern: str, **axes_lengths) -> Tensor → function repeat(tensor: List[Tensor], pattern: str, **axes_lengths: Size) -> Tensor | (tensor: Tensor, pattern: str, **axes_lengths: Size) -> Tensor
  • added: variable Size
  • removed: function pack(pattern: str, tensors: Sequence[T]) -> Tuple[T, List[Shape]]
  • removed: function prod(x: Shape) -> int
  • removed: function unpack(pattern: str, tensor: T, packed_shapes: List[Shape]) -> List[T]
  • removed: variable C
  • removed: variable H
  • removed: variable Shape
  • removed: variable T
  • removed: variable W
  • removed: variable b
  • removed: variable b2
  • removed: variable embeddings
  • removed: variable embeddings2
  • removed: variable g
  • removed: variable g2
  • removed: variable im
  • removed: variable image
  • removed: variable images_and_embedding
  • removed: variable r
  • removed: variable r2
  • removed: variable shapes
  • removed: class CompositionDecomposition
  • removed: class IndexingFormula
  • removed: constructor CompositionDecomposition(decomposed_shape: List[str], composed_shape: List[List[str]])
  • removed: constructor IndexingFormula(pattern: str)
  • removed: function arange_at_position(xp, n_axes, axis, axis_len, device=…)
  • removed: function einindex(pattern: str, arr: T, /, ind: Union[T, List[T]])
  • removed: function test_composition_and_decomposition()
  • removed: function test_multidimensional_indexing()
  • removed: function test_reverse_indexing()
  • removed: function test_simple_indexing()
  • removed: method CompositionDecomposition.compose(x, known_axes_lengths: dict[str, int])
  • removed: method CompositionDecomposition.decompose(x, known_axes_lengths: dict[str, int])
  • removed: method IndexingFormula.apply_to_array_api(arr: T, ind: Union[T, List[T]])
  • removed: variable T
  • removed: class EinMix(_EinmixMixin, chainer.Link)
  • removed: class Rearrange(RearrangeMixin, chainer.Link)
  • removed: class Reduce(ReduceMixin, chainer.Link)
  • removed: method Rearrange.compute_output_shape(input_shape)
  • removed: method Reduce.compute_output_shape(input_shape)
  • added: method Rearrange.build(input_shape)
  • added: method Reduce.build(input_shape)
  • changed: class AnonymousAxis(object) → class AnonymousAxis