Upgrading einops 0.3 to 0.4
Breaking0.3.2 → 0.4.1Breaking1New5Changed2Fixed1Other4
BreakingUpgrade verdict
1 breaking change.
In plain terms
- Calling parse_shape with a pattern that repeats an axis name now raises an error instead of being accepted.
Must act 1 item needs code or config changes
What you must change
Breaking1
Rejects repeated axes in parse_shape.
parse_shapeAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- removed:
method TransformRecipe.apply(tensor) - removed:
method TransformRecipe.reconstruct_from_shape(shape, optimize=…) - changed:
constructor TransformRecipe(elementary_axes_lengths: List, input_composite_axes: List[Tuple[List[int], List[int]]], reduced_elementary_axes: Tuple[int], axes_permutation: Tuple[int], added_axes: Dict[int, int], output_composite_axes: List[List[int]], reduction_type: Reduction=…, ellipsis_position_in_lhs: int=…) → constructor TransformRecipe(elementary_axes_lengths: List[int], input_composite_axes: List[Tuple[List[int], List[int]]], reduced_elementary_axes: List[int], axes_permutation: List[int], added_axes: Dict[int, int], output_composite_axes: List[List[int]], ellipsis_position_in_lhs: Optional[int]=…) - changed:
function asnumpy(tensor) → function asnumpy(tensor) -> numpy.ndarray - changed:
function rearrange(tensor, pattern: str, **axes_lengths) → function rearrange(tensor: Tensor, pattern: str, **axes_length: int) -> Tensor | (tensor: List[Tensor], pattern: str, **axes_lengths: int) -> Tensor - changed:
function reduce(tensor, pattern: str, reduction: Reduction, **axes_lengths: int) → function reduce(tensor: Tensor, pattern: str, reduction: Reduction, **axes_lengths: int) -> Tensor - changed:
function repeat(tensor, pattern: str, **axes_lengths) → function repeat(tensor: Tensor, pattern: str, **axes_lengths) -> Tensor - added:
function is_ellipsis_not_in_parenthesis(group: List[int]) -> bool - added:
variable CookedRecipe - added:
variable Tensor
- removed:
class WeightedEinsum(WeightedEinsumMixin, chainer.Link) - added:
class EinMix(_EinmixMixin, chainer.Link)
- removed:
class WeightedEinsum(WeightedEinsumMixin, mxnet.gluon.HybridBlock) - removed:
method WeightedEinsum.hybrid_forward(F, x, *args, **kwargs) - added:
class EinMix(_EinmixMixin, mxnet.gluon.HybridBlock) - added:
method EinMix.hybrid_forward(F, x, *args, **kwargs)
- removed:
class Rearrange(RearrangeMixin, Layer) - removed:
class Reduce(ReduceMixin, Layer) - removed:
method Rearrange.call(inputs) - removed:
method Rearrange.compute_output_shape(input_shape) - removed:
method Rearrange.get_config() - removed:
method Reduce.call(inputs) - removed:
method Reduce.compute_output_shape(input_shape) - removed:
method Reduce.get_config()
- removed:
class WeightedEinsum(WeightedEinsumMixin, Layer) - removed:
method WeightedEinsum.build(input_shape) - removed:
method WeightedEinsum.call(inputs) - removed:
method WeightedEinsum.get_config() - added:
class EinMix(_EinmixMixin, Layer) - added:
method EinMix.build(input_shape) - added:
method EinMix.call(inputs) - added:
method EinMix.get_config()
- removed:
class WeightedEinsum(WeightedEinsumMixin, torch.nn.Module) - removed:
method WeightedEinsum.forward(input) - added:
class EinMix(_EinmixMixin, torch.nn.Module) - added:
method EinMix.forward(input)
- changed:
constructor ParsedExpression(expression) → constructor ParsedExpression(expression, *, allow_underscore: bool=…) - changed:
static method ParsedExpression.check_axis_name(name: str, return_reason=…) → static method ParsedExpression.check_axis_name(name: str) -> bool - added:
static method ParsedExpression.check_axis_name_return_reason(name: str, allow_underscore: bool=…) -> Tuple[bool, str]