E-TE0605 — Axis specified for the two-argument form of min/max
Error Type |
|
|---|---|
Phase |
building expressions from Python |
Python exception |
|
Message
`axis` cannot be specified when calling `jijmodeling.{function}` with two expressions.
Possible fix: drop `axis=`, or pass a single tensor-like expression instead.
({function} is min or max, depending on which function was called)
Cause
jm.min or jm.max was called with two positional arguments and an axis= keyword at the same time.
The two-argument form picks the smaller or larger of two expressions, so there is no tensor whose axes could be reduced and axis= has no meaning there.
The method forms count the receiver as the first argument, so x.min(y, axis=0) and x.max(y, axis=0) trigger this error as well.
Fix
Decide which of the two behaviors you want and adjust the call accordingly:
jm.min(a, b) # smaller of two expressions: drop axis=
jm.min(A, axis=0) # reduce a tensor along axis 0: pass a single expression