| assert_known_dims | R Documentation |
Ensure that a specific dimension is known, i.e. not NA.
assert_known_dims(shape, dims, what, id = NULL)
shape |
( |
dims |
( |
what |
( |
id |
( |
The shape, invisibly.
Other Shape Assertions:
assert_dim_in_range(),
assert_ndim(),
assert_not_batch_dim(),
assert_positive_extent(),
assert_same_batch_size(),
assert_same_ndim(),
assert_shape(),
assert_shapes()
# a convolution needs the number of input channels, but not the spatial extent
assert_known_dims(c(NA, 3, NA, NA), 2, "the number of channels", id = "nn_conv2d")
try(assert_known_dims(c(NA, NA, 10, 10), 2, "the number of channels", id = "nn_conv2d"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.