Checks that shape is a valid shape, i.e. an integer() with at least one dimension, NA where
a dimension is unknown. See the "Shape Inference" section of PipeOpTorch for the conventions.
Arguments
- shape
(
integer())
A shape, withNAfor the dimensions whose size is unknown.- null_ok
(
logical(1))
WhetherNULL, i.e. a wholly unknown shape, is valid.- coerce
(
logical(1))
Whether to coerce the input to aninteger()if possible.- unknown_batch
(
logical(1)|NULL)
Whether the batch dimension must be unknown, i.e.NA. If leftNULL(default), the first dimension can beNAor not.- len
(
integer(1))
The required number of dimensions.
Value
The shape, coerced to an integer() if coerce is TRUE.