Document and test input_shape
and output_shape
policy
#234
Labels
documentation
Improvements or additions to documentation
input_shape
and output_shape
policy
#234
Proposed
input_shape
andoutput_shape
policy:Operator
s must haveinput_shape
andoutput_shape
propertiesOperator
H
,H(x)
should throw an error ifx
is notinput_shape
Operator
s should be written so thatH(x).shape
isH.output_shape
; this will not be checked and runtime, but should be testedOperator
s should attempt to automatically deduceinput_shape
andoutput_shape
from other arguments and throw an error if the user requests aninput_shape
oroutput_shape
that is not realizableinput_shape
and/oroutput_shape
input_shape
and/oroutput_shape
when not needed to prevent them from being automatically deduced (for speed)This policy should be described in the docs and implemented in the code.
Why this?
While some operators can conceptually work with different input sizes, trying to allow this creates downstream problems, e.g., what is the adjoint of a sum operator (one that sums all the elements of a vector) applied to the scalar 1.0? How does one initialize an optimization routine without knowing input shapes for operators?
The text was updated successfully, but these errors were encountered: