| assert_ndim | R Documentation |
Rejects a shape with the wrong number of dimensions. Give either ndim, the number(s) of
dimensions the operator accepts, or the bounds min and max (either on its own), which is what
an operator that accepts a range of them uses, as batch normalization does.
assert_ndim(shape, ndim = NULL, id, min = NULL, max = NULL)
shape |
( |
ndim |
( |
id |
( |
min |
( |
max |
( |
The shape, invisibly.
Other Shape Assertions:
assert_dim_in_range(),
assert_known_dims(),
assert_not_batch_dim(),
assert_positive_extent(),
assert_same_batch_size(),
assert_same_ndim(),
assert_shape(),
assert_shapes()
assert_ndim(c(NA, 3, 32, 32), 4L, id = "nn_conv2d")
try(assert_ndim(c(NA, 3), 4L, id = "nn_conv2d"))
# batch normalization accepts a range
try(assert_ndim(c(NA, 3, 4, 5), id = "nn_batch_norm1d", min = 2L, max = 3L))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.