| assert_dim_in_range | R Documentation |
Rejects a dim parameter that does not address a dimension of shape. Resolve negative indices
with resolve_dim() first and pass both, so that the error message can report the value the
user actually specified.
assert_dim_in_range(dim, true_dim, shape, id)
dim |
( |
true_dim |
( |
shape |
( |
id |
( |
The resolved dimension, invisibly.
Other Shape Assertions:
assert_known_dims(),
assert_ndim(),
assert_not_batch_dim(),
assert_positive_extent(),
assert_same_batch_size(),
assert_same_ndim(),
assert_shape(),
assert_shapes()
shape = c(NA, 3, 8, 8)
assert_dim_in_range(-1L, resolve_dim(-1L, shape), shape, id = "nn_squeeze")
try(assert_dim_in_range(-5L, resolve_dim(-5L, shape), shape, id = "nn_squeeze"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.