Skip to content

Commit bc9e1e7

Browse files
committed
...
1 parent 2a0337b commit bc9e1e7

6 files changed

+6
-5
lines changed

R/PipeOpTaskPreprocTorch.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ pipeop_preproc_torch = function(id, fn, shapes_out = NULL, param_set = NULL, pac
449449
# we e.g. want torchvision in suggests, so we cannot already access the function.
450450
if (identical(shapes_out, "infer")) {
451451
shapes_out = crate(function(shapes_in, param_vals, task) {
452-
getFromNamespace("infer_shapes", "mlr3torch")(shapes_in = shapes_in, param_vals = param_vals, output_names = self$output$name, fn = self$fn, rowwise = self$rowwise, id = self$id)
452+
getFromNamespace("infer_shapes", "mlr3torch")(shapes_in = shapes_in, param_vals = param_vals, output_names = self$output$name, fn = self$fn, rowwise = self$rowwise, id = self$id) # nolint
453453
})
454454
} else if (is.function(shapes_out) || is.null(shapes_out)) {
455455
# nothing to do

R/PipeOpTorchReshape.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#' This internally calls [`torch::torch_reshape()`] with the given `shape`.
66
#' @section Parameters:
77
#' * `shape` :: `integer(1)`\cr
8-
#' The desired output shape. Unknown dimension (one at most) can either be specified as `-1` or `NA`.
8+
#' The desired output shape. Unknown dimension (one at most) can either be specified as `-1`.
99
#' @templateVar id nn_reshape
1010
#' @template pipeop_torch_channels_default
1111
#' @template pipeop_torch

R/lazy_tensor.R

+1
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ is_lazy_tensor = function(x) {
231231
#' Is not cloned, so should be cloned beforehand.
232232
#' @param shape (`integer()` or `NULL`)\cr
233233
#' The shape of the lazy tensor.
234+
#' `NA`s indicate dimensions where the shape is not known.
234235
#' @param shape_predict (`integer()` or `NULL`)\cr
235236
#' The shape of the lazy tensor if it was applied during `$predict()`.
236237
#'

R/shape.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ assert_rgb_shape = function(shape) {
8989

9090
# grayscale or rgb image
9191
assert_grayscale_or_rgb = function(shape) {
92-
assert_shape(shape, len = 4L, null_ok = FALSE)
92+
assert_shape(shape, len = 4L, null_ok = FALSE, only_batch_unknown = TRUE)
9393
assert_true(shape[2L] == 3L || shape[2L] == 1L)
9494
}
9595

man/TorchIngressToken.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/mlr_pipeops_nn_reshape.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)