+ All Categories
Home > Documents > Package ‘torch’ · 2021. 1. 5. · Package ‘torch’ January 5, 2021 Type Package Title...

Package ‘torch’ · 2021. 1. 5. · Package ‘torch’ January 5, 2021 Type Package Title...

Date post: 09-Feb-2021
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
524
Package ‘torch’ June 10, 2021 Type Package Title Tensors and Neural Networks with 'GPU' Acceleration Version 0.4.0 Description Provides functionality to define and train neural networks similar to 'PyTorch' by Paszke et al (2019) <arXiv:1912.01703> but written entirely in R using the 'libtorch' library. Also supports low-level tensor operations and 'GPU' acceleration. License MIT + file LICENSE URL https://torch.mlverse.org/docs, https://github.com/mlverse/torch BugReports https://github.com/mlverse/torch/issues Encoding UTF-8 SystemRequirements C++11, LibTorch (https://pytorch.org/) LinkingTo Rcpp Imports Rcpp, R6, withr, rlang, methods, utils, stats, bit64, magrittr, tools, coro, callr, cli, ellipsis RoxygenNote 7.1.1 Suggests testthat (>= 3.0.0), covr, knitr, rmarkdown, glue, palmerpenguins, mvtnorm, numDeriv VignetteBuilder knitr Collate 'R7.R' 'RcppExports.R' 'tensor.R' 'autograd.R' 'backends.R' 'codegen-utils.R' 'conditions.R' 'creation-ops.R' 'cuda.R' 'device.R' 'dimname_list.R' 'utils.R' 'distributions-constraints.R' 'distributions-utils.R' 'distributions-exp-family.R' 'distributions.R' 'distributions-bernoulli.R' 'distributions-categorical.R' 'distributions-gamma.R' 'distributions-chi2.R' 'distributions-mixture_same_family.R' 'distributions-multivariate_normal.R' 'distributions-normal.R' 'distributions-poisson.R' 'dtype.R' 'gen-method.R' 'gen-namespace-docs.R' 'gen-namespace-examples.R' 'gen-namespace.R' 'generator.R' 'help.R' 'indexing.R' 1
Transcript
  • Package ‘torch’June 10, 2021

    Type PackageTitle Tensors and Neural Networks with 'GPU' AccelerationVersion 0.4.0Description Provides functionality to define and train neural networks similar to

    'PyTorch' by Paszke et al (2019) but written entirely in Rusing the 'libtorch' library. Also supports low-level tensor operations and'GPU' acceleration.

    License MIT + file LICENSE

    URL https://torch.mlverse.org/docs, https://github.com/mlverse/torch

    BugReports https://github.com/mlverse/torch/issuesEncoding UTF-8SystemRequirements C++11, LibTorch (https://pytorch.org/)LinkingTo RcppImports Rcpp, R6, withr, rlang, methods, utils, stats, bit64,

    magrittr, tools, coro, callr, cli, ellipsis

    RoxygenNote 7.1.1Suggests testthat (>= 3.0.0), covr, knitr, rmarkdown, glue,

    palmerpenguins, mvtnorm, numDeriv

    VignetteBuilder knitrCollate 'R7.R' 'RcppExports.R' 'tensor.R' 'autograd.R' 'backends.R'

    'codegen-utils.R' 'conditions.R' 'creation-ops.R' 'cuda.R''device.R' 'dimname_list.R' 'utils.R''distributions-constraints.R' 'distributions-utils.R''distributions-exp-family.R' 'distributions.R''distributions-bernoulli.R' 'distributions-categorical.R''distributions-gamma.R' 'distributions-chi2.R''distributions-mixture_same_family.R''distributions-multivariate_normal.R' 'distributions-normal.R''distributions-poisson.R' 'dtype.R' 'gen-method.R''gen-namespace-docs.R' 'gen-namespace-examples.R''gen-namespace.R' 'generator.R' 'help.R' 'indexing.R'

    1

    https://arxiv.org/abs/1912.01703https://torch.mlverse.org/docshttps://github.com/mlverse/torchhttps://github.com/mlverse/torch/issues

  • 2 R topics documented:

    'install.R' 'lantern_load.R' 'lantern_sync.R' 'layout.R''memory_format.R' 'utils-data.R' 'nn.R' 'nn-activation.R''nn-batchnorm.R' 'nn-conv.R' 'nn-distance.R' 'nn-dropout.R''nn-init.R' 'nn-linear.R' 'nn-loss.R' 'nn-normalization.R''nn-pooling.R' 'nn-rnn.R' 'nn-sparse.R' 'nn-utils-clip-grad.R''nn-utils-rnn.R' 'nn-utils.R' 'nn_adaptive.R''nnf-activation.R' 'nnf-batchnorm.R' 'nnf-conv.R''nnf-distance.R' 'nnf-dropout.R' 'nnf-embedding.R' 'nnf-fold.R''nnf-instancenorm.R' 'nnf-linear.R' 'nnf-loss.R''nnf-normalization.R' 'nnf-padding.R' 'nnf-pixelshuffle.R''nnf-pooling.R' 'nnf-upsampling.R' 'nnf-vision.R' 'operators.R''optim.R' 'optim-adadelta.R' 'optim-adagrad.R' 'optim-adam.R''optim-asgd.R' 'optim-lbfgs.R' 'optim-lr_scheduler.R''optim-rmsprop.R' 'optim-rprop.R' 'optim-sgd.R' 'package.R''qscheme.R' 'quantization.R' 'reduction.R' 'save.R' 'scalar.R''stack.R' 'storage.R' 'tensor_options.R' 'threads.R' 'trace.R''type-info.R' 'utils-data-collate.R' 'utils-data-dataloader.R''utils-data-enum.R' 'utils-data-fetcher.R''utils-data-sampler.R' 'utils-pipe.R' 'variable_list.R''with-indices.R' 'wrapers.R'

    NeedsCompilation yes

    Author Daniel Falbel [aut, cre, cph],Javier Luraschi [aut],Dmitriy Selivanov [ctb],Athos Damiani [ctb],Christophe Regouby [ctb],Krzysztof Joachimiak [ctb],RStudio [cph]

    Maintainer Daniel Falbel

    Repository CRAN

    Date/Publication 2021-06-10 15:00:02 UTC

    R topics documented:as_array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15AutogradContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16autograd_backward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18autograd_function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19autograd_grad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20autograd_set_grad_mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21backends_mkldnn_is_available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21backends_mkl_is_available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22backends_openmp_is_available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22broadcast_all . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Constraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23cuda_current_device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

  • R topics documented: 3

    cuda_device_count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24cuda_is_available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25dataloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25dataloader_make_iter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27dataloader_next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27dataset_subset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29distr_bernoulli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32distr_categorical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33distr_chi2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34distr_gamma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34distr_mixture_same_family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35distr_multivariate_normal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36distr_normal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37distr_poisson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38enumerate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39enumerate.dataloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39get_install_libs_url . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40install_torch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40install_torch_from_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41is_dataloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42is_nn_buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42is_nn_module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42is_nn_parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43is_optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43is_torch_device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43is_torch_dtype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44is_torch_layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44is_torch_memory_format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44is_torch_qscheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45is_undefined_tensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45jit_load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45jit_save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46jit_trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46load_state_dict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48lr_lambda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48lr_multiplicative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49lr_one_cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50lr_scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52lr_step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53nnf_adaptive_avg_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54nnf_adaptive_avg_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54nnf_adaptive_avg_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55nnf_adaptive_max_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55nnf_adaptive_max_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56nnf_adaptive_max_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56nnf_affine_grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

  • 4 R topics documented:

    nnf_alpha_dropout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57nnf_avg_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58nnf_avg_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58nnf_avg_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59nnf_batch_norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60nnf_bilinear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61nnf_binary_cross_entropy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61nnf_binary_cross_entropy_with_logits . . . . . . . . . . . . . . . . . . . . . . . . . . . 62nnf_celu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63nnf_contrib_sparsemax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63nnf_conv1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64nnf_conv2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64nnf_conv3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65nnf_conv_tbc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66nnf_conv_transpose1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67nnf_conv_transpose2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68nnf_conv_transpose3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69nnf_cosine_embedding_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70nnf_cosine_similarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70nnf_cross_entropy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71nnf_ctc_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72nnf_dropout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73nnf_dropout2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73nnf_dropout3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74nnf_elu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74nnf_embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75nnf_embedding_bag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76nnf_fold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77nnf_fractional_max_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78nnf_fractional_max_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79nnf_gelu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80nnf_glu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80nnf_grid_sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81nnf_group_norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82nnf_gumbel_softmax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83nnf_hardshrink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83nnf_hardsigmoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84nnf_hardswish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84nnf_hardtanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85nnf_hinge_embedding_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85nnf_instance_norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86nnf_interpolate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86nnf_kl_div . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88nnf_l1_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88nnf_layer_norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89nnf_leaky_relu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89nnf_linear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90nnf_local_response_norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

  • R topics documented: 5

    nnf_logsigmoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91nnf_log_softmax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91nnf_lp_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92nnf_lp_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92nnf_margin_ranking_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93nnf_max_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93nnf_max_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94nnf_max_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95nnf_max_unpool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95nnf_max_unpool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96nnf_max_unpool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97nnf_mse_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97nnf_multilabel_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98nnf_multilabel_soft_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98nnf_multi_head_attention_forward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99nnf_multi_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101nnf_nll_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102nnf_normalize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102nnf_one_hot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103nnf_pad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104nnf_pairwise_distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104nnf_pdist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105nnf_pixel_shuffle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105nnf_poisson_nll_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106nnf_prelu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106nnf_relu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107nnf_relu6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107nnf_rrelu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108nnf_selu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108nnf_sigmoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109nnf_smooth_l1_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109nnf_softmax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110nnf_softmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110nnf_softplus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111nnf_softshrink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112nnf_softsign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112nnf_soft_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113nnf_tanhshrink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113nnf_threshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114nnf_triplet_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114nnf_triplet_margin_with_distance_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . 115nnf_unfold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116nn_adaptive_avg_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117nn_adaptive_avg_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117nn_adaptive_avg_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118nn_adaptive_log_softmax_with_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119nn_adaptive_max_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121nn_adaptive_max_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

  • 6 R topics documented:

    nn_adaptive_max_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122nn_avg_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123nn_avg_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124nn_avg_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126nn_batch_norm1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127nn_batch_norm2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129nn_batch_norm3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130nn_bce_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132nn_bce_with_logits_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133nn_bilinear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135nn_buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136nn_celu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136nn_contrib_sparsemax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137nn_conv1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137nn_conv2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140nn_conv3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142nn_conv_transpose1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145nn_conv_transpose2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147nn_conv_transpose3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149nn_cosine_embedding_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152nn_cross_entropy_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153nn_ctc_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154nn_dropout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156nn_dropout2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157nn_dropout3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158nn_elu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159nn_embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160nn_fractional_max_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161nn_fractional_max_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162nn_gelu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163nn_glu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164nn_group_norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165nn_gru . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166nn_hardshrink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168nn_hardsigmoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169nn_hardswish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169nn_hardtanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170nn_hinge_embedding_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171nn_identity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172nn_init_calculate_gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172nn_init_constant_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173nn_init_dirac_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173nn_init_eye_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174nn_init_kaiming_normal_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174nn_init_kaiming_uniform_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175nn_init_normal_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176nn_init_ones_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177nn_init_orthogonal_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

  • R topics documented: 7

    nn_init_sparse_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178nn_init_trunc_normal_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179nn_init_uniform_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179nn_init_xavier_normal_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180nn_init_xavier_uniform_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180nn_init_zeros_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181nn_kl_div_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182nn_l1_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183nn_layer_norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184nn_leaky_relu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186nn_linear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187nn_log_sigmoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188nn_log_softmax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188nn_lp_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189nn_lp_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190nn_lstm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192nn_margin_ranking_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194nn_max_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195nn_max_pool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196nn_max_pool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198nn_max_unpool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199nn_max_unpool2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200nn_max_unpool3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202nn_module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203nn_module_list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205nn_mse_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205nn_multihead_attention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207nn_multilabel_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208nn_multilabel_soft_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210nn_multi_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211nn_nll_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212nn_pairwise_distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213nn_parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214nn_poisson_nll_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215nn_prelu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216nn_relu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217nn_relu6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218nn_rnn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218nn_rrelu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221nn_selu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222nn_sequential . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223nn_sigmoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223nn_smooth_l1_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224nn_softmax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225nn_softmax2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226nn_softmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227nn_softplus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228nn_softshrink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

  • 8 R topics documented:

    nn_softsign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229nn_soft_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230nn_tanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231nn_tanhshrink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231nn_threshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232nn_triplet_margin_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233nn_triplet_margin_with_distance_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . 234nn_utils_clip_grad_norm_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236nn_utils_clip_grad_value_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237nn_utils_rnn_pack_padded_sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . 237nn_utils_rnn_pack_sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238nn_utils_rnn_pad_packed_sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239nn_utils_rnn_pad_sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241optim_adadelta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243optim_adagrad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244optim_adam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245optim_asgd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246optim_lbfgs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247optim_required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248optim_rmsprop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248optim_rprop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249optim_sgd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250tensor_dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251torch_abs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252torch_absolute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253torch_acos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253torch_acosh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254torch_adaptive_avg_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254torch_add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255torch_addbmm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256torch_addcdiv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257torch_addcmul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258torch_addmm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259torch_addmv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260torch_addr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261torch_allclose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262torch_amax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263torch_amin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264torch_angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265torch_arange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265torch_arccos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266torch_arccosh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267torch_arcsin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267torch_arcsinh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268torch_arctan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268torch_arctanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269

  • R topics documented: 9

    torch_argmax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269torch_argmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270torch_argsort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271torch_asin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272torch_asinh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272torch_as_strided . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273torch_atan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274torch_atan2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275torch_atanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275torch_atleast_1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276torch_atleast_2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277torch_atleast_3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277torch_avg_pool1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278torch_baddbmm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279torch_bartlett_window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280torch_bernoulli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281torch_bincount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282torch_bitwise_and . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283torch_bitwise_not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283torch_bitwise_or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284torch_bitwise_xor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284torch_blackman_window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285torch_block_diag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286torch_bmm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286torch_broadcast_tensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287torch_bucketize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288torch_can_cast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289torch_cartesian_prod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289torch_cat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290torch_cdist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291torch_ceil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291torch_celu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292torch_celu_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293torch_chain_matmul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293torch_channel_shuffle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294torch_cholesky . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295torch_cholesky_inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296torch_cholesky_solve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297torch_chunk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298torch_clamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299torch_clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300torch_clone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301torch_combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301torch_complex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302torch_conj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303torch_conv1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303torch_conv2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304torch_conv3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

  • 10 R topics documented:

    torch_conv_tbc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306torch_conv_transpose1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307torch_conv_transpose2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308torch_conv_transpose3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309torch_cos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310torch_cosh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311torch_cosine_similarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312torch_count_nonzero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312torch_cross . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313torch_cummax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314torch_cummin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315torch_cumprod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315torch_cumsum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316torch_deg2rad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317torch_dequantize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317torch_det . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318torch_device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319torch_diag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319torch_diagflat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320torch_diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321torch_diag_embed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322torch_diff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323torch_digamma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324torch_dist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324torch_div . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325torch_divide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326torch_dot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327torch_dstack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328torch_dtype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329torch_eig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330torch_einsum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330torch_empty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331torch_empty_like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332torch_empty_strided . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333torch_eq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335torch_equal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335torch_erf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336torch_erfc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337torch_erfinv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337torch_exp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338torch_exp2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339torch_expm1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339torch_eye . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340torch_fft_fft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341torch_fft_ifft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342torch_fft_irfft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343torch_fft_rfft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344torch_finfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

  • R topics documented: 11

    torch_fix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345torch_flatten . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346torch_flip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346torch_fliplr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347torch_flipud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348torch_floor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349torch_floor_divide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349torch_fmod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350torch_frac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351torch_full . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351torch_full_like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352torch_gather . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353torch_gcd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354torch_ge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355torch_generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356torch_geqrf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356torch_ger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357torch_greater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358torch_greater_equal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358torch_gt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359torch_hamming_window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359torch_hann_window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361torch_heaviside . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362torch_histc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363torch_hstack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363torch_hypot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364torch_i0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365torch_iinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365torch_imag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366torch_index_select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366torch_inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367torch_isclose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368torch_isfinite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369torch_isinf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370torch_isnan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370torch_isneginf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371torch_isposinf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371torch_isreal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372torch_istft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373torch_is_complex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374torch_is_floating_point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375torch_is_installed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375torch_is_nonzero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376torch_kaiser_window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376torch_kthvalue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378torch_layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379torch_lcm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379torch_le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380

  • 12 R topics documented:

    torch_lerp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381torch_less . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382torch_less_equal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382torch_lgamma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383torch_linspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383torch_load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384torch_log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385torch_log10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385torch_log1p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386torch_log2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387torch_logaddexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387torch_logaddexp2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388torch_logcumsumexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389torch_logdet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389torch_logical_and . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390torch_logical_not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391torch_logical_or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392torch_logical_xor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392torch_logit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393torch_logspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394torch_logsumexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395torch_lstsq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396torch_lt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397torch_lu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398torch_lu_solve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398torch_manual_seed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399torch_masked_select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400torch_matmul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401torch_matrix_exp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402torch_matrix_power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403torch_matrix_rank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404torch_max . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404torch_maximum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406torch_mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407torch_median . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408torch_memory_format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409torch_meshgrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409torch_min . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410torch_minimum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411torch_mm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412torch_mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413torch_movedim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414torch_mul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414torch_multinomial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415torch_multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417torch_mv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417torch_mvlgamma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418torch_nanquantile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419

  • R topics documented: 13

    torch_nansum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420torch_narrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421torch_ne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421torch_neg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422torch_negative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423torch_nextafter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423torch_nonzero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424torch_norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425torch_normal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426torch_not_equal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427torch_ones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428torch_ones_like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429torch_orgqr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430torch_ormqr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430torch_outer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431torch_pdist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432torch_pinverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432torch_pixel_shuffle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433torch_poisson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434torch_polar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435torch_polygamma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435torch_pow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436torch_prod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438torch_promote_types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439torch_qr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439torch_qscheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440torch_quantile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441torch_quantize_per_channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442torch_quantize_per_tensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442torch_rad2deg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443torch_rand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444torch_randint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445torch_randint_like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446torch_randn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447torch_randn_like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448torch_randperm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449torch_rand_like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450torch_range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451torch_real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452torch_reciprocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453torch_reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453torch_relu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454torch_relu_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454torch_remainder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455torch_renorm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455torch_repeat_interleave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456torch_reshape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457torch_result_type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458

  • 14 R topics documented:

    torch_roll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459torch_rot90 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459torch_round . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460torch_rrelu_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461torch_rsqrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461torch_save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462torch_scalar_tensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463torch_searchsorted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463torch_selu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464torch_selu_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465torch_set_default_dtype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465torch_sgn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466torch_sigmoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466torch_sign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467torch_signbit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468torch_sin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468torch_sinh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469torch_slogdet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470torch_solve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471torch_sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472torch_sparse_coo_tensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473torch_split . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474torch_sqrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475torch_square . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475torch_squeeze . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476torch_stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477torch_std . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477torch_std_mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478torch_stft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479torch_sub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481torch_subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482torch_sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483torch_svd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484torch_symeig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485torch_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487torch_take . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487torch_tan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488torch_tanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489torch_tensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489torch_tensordot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490torch_threshold_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491torch_topk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491torch_trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492torch_transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493torch_trapz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493torch_triangular_solve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494torch_tril . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495torch_tril_indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496

  • as_array 15

    torch_triu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497torch_triu_indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498torch_true_divide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500torch_trunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500torch_unbind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501torch_unique_consecutive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502torch_unsafe_chunk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503torch_unsafe_split . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503torch_unsqueeze . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504torch_vander . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505torch_var . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505torch_var_mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506torch_vdot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507torch_view_as_complex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508torch_view_as_real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509torch_vstack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510torch_where . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510torch_zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511torch_zeros_like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512with_enable_grad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514with_no_grad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514

    Index 516

    as_array Converts to array

    Description

    Converts to array

    Usage

    as_array(x)

    Arguments

    x object to be converted into an array

  • 16 AutogradContext

    AutogradContext Class representing the context.

    Description

    Class representing the context.

    Class representing the context.

    Public fields

    ptr (Dev related) pointer to the context c++ object.

    Active bindings

    needs_input_grad boolean listing arguments of forward and whether they require_grad.saved_variables list of objects that were saved for backward via save_for_backward.

    Methods

    Public methods:• AutogradContext$new()• AutogradContext$save_for_backward()• AutogradContext$mark_non_differentiable()• AutogradContext$mark_dirty()• AutogradContext$clone()

    Method new(): (Dev related) Initializes the context. Not user related.Usage:AutogradContext$new(ptr,env,argument_names = NULL,argument_needs_grad = NULL

    )

    Arguments:ptr pointer to the c++ objectenv environment that encloses both forward and backwardargument_names names of forward argumentsargument_needs_grad whether each argument in forward needs grad.

    Method save_for_backward(): Saves given objects for a future call to backward().This should be called at most once, and only from inside the forward() method.Later, saved objects can be accessed through the saved_variables attribute. Before returningthem to the user, a check is made to ensure they weren’t used in any in-place operation thatmodified their content.Arguments can also be any kind of R object.

  • AutogradContext 17

    Usage:

    AutogradContext$save_for_backward(...)

    Arguments:

    ... any kind of R object that will be saved for the backward pass. It’s common to pass namedarguments.

    Method mark_non_differentiable(): Marks outputs as non-differentiable.This should be called at most once, only from inside the forward() method, and all argumentsshould be outputs.

    This will mark outputs as not requiring gradients, increasing the efficiency of backward compu-tation. You still need to accept a gradient for each output in backward(), but it’s always going tobe a zero tensor with the same shape as the shape of a corresponding output.

    This is used e.g. for indices returned from a max Function.

    Usage:

    AutogradContext$mark_non_differentiable(...)

    Arguments:

    ... non-differentiable outputs.

    Method mark_dirty(): Marks given tensors as modified in an in-place operation.This should be called at most once, only from inside the forward() method, and all argumentsshould be inputs.

    Every tensor that’s been modified in-place in a call to forward() should be given to this function,to ensure correctness of our checks. It doesn’t matter whether the function is called before or aftermodification.

    Usage:

    AutogradContext$mark_dirty(...)

    Arguments:

    ... tensors that are modified in-place.

    Method clone(): The objects of this class are cloneable with this method.

    Usage:

    AutogradContext$clone(deep = FALSE)

    Arguments:

    deep Whether to make a deep clone.

  • 18 autograd_backward

    autograd_backward Computes the sum of gradients of given tensors w.r.t. graph leaves.

    Description

    The graph is differentiated using the chain rule. If any of tensors are non-scalar (i.e. their data hasmore than one element) and require gradient, then the Jacobian-vector product would be computed,in this case the function additionally requires specifying grad_tensors. It should be a sequence ofmatching length, that contains the “vector” in the Jacobian-vector product, usually the gradient ofthe differentiated function w.r.t. corresponding tensors (None is an acceptable value for all tensorsthat don’t need gradient tensors).

    Usage

    autograd_backward(tensors,grad_tensors = NULL,retain_graph = create_graph,create_graph = FALSE

    )

    Arguments

    tensors (list of Tensor) – Tensors of which the derivative will be computed.

    grad_tensors (list of (Tensor or NULL)) – The “vector” in the Jacobian-vector product, usu-ally gradients w.r.t. each element of corresponding tensors. NULLvalues can be spec-ified for scalar Tensors or ones that don’t require grad. If aNULL‘ value wouldbe acceptable for all grad_tensors, then this argument is optional.

    retain_graph (bool, optional) – If FALSE, the graph used to compute the grad will be freed.Note that in nearly all cases setting this option to TRUE is not needed and oftencan be worked around in a much more efficient way. Defaults to the value ofcreate_graph.

    create_graph (bool, optional) – If TRUE, graph of the derivative will be constructed, allowingto compute higher order derivative products. Defaults to FALSE.

    Details

    This function accumulates gradients in the leaves - you might need to zero them before calling it.

    Examples

    if (torch_is_installed()) {x

  • autograd_function 19

    autograd_backward(list(y, b))

    }

    autograd_function Records operation history and defines formulas for differentiating ops.

    Description

    Every operation performed on Tensor’s creates a new function object, that performs the computa-tion, and records that it happened. The history is retained in the form of a DAG of functions, withedges denoting data dependencies (input

  • 20 autograd_grad

    list(i = grad_output * ctx$saved_variable$result)}

    )

    }

    autograd_grad Computes and returns the sum of gradients of outputs w.r.t. the inputs.

    Description

    grad_outputs should be a list of length matching output containing the “vector” in Jacobian-vectorproduct, usually the pre-computed gradients w.r.t. each of the outputs. If an output doesn’t re-quire_grad, then the gradient can be None).

    Usage

    autograd_grad(outputs,inputs,grad_outputs = NULL,retain_graph = create_graph,create_graph = FALSE,allow_unused = FALSE

    )

    Arguments

    outputs (sequence of Tensor) – outputs of the differentiated function.

    inputs (sequence of Tensor) – Inputs w.r.t. which the gradient will be returned (and notaccumulated into .grad).

    grad_outputs (sequence of Tensor) – The “vector” in the Jacobian-vector product. Usuallygradients w.r.t. each output. None values can be specified for scalar Tensorsor ones that don’t require grad. If a None value would be acceptable for allgrad_tensors, then this argument is optional. Default: None.

    retain_graph (bool, optional) – If FALSE, the graph used to compute the grad will be freed.Note that in nearly all cases setting this option to TRUE is not needed and oftencan be worked around in a much more efficient way. Defaults to the value ofcreate_graph.

    create_graph (bool, optional) – If TRUE, graph of the derivative will be constructed, allow-ing to compute higher order derivative products. Default: FALSE‘.

    allow_unused (bool, optional) – If FALSE, specifying inputs that were not used when computingoutputs (and therefore their grad is always zero) is an error. Defaults to FALSE

  • autograd_set_grad_mode 21

    Details

    If only_inputs is TRUE, the function will only return a list of gradients w.r.t the specified inputs. Ifit’s FALSE, then gradient w.r.t. all remaining leaves will still be computed, and will be accumulatedinto their .grad attribute.

    Examples

    if (torch_is_installed()) {w

  • 22 backends_openmp_is_available

    Value

    Returns whether LibTorch is built with MKL-DNN support.

    backends_mkl_is_available

    MKL is available

    Description

    MKL is available

    Usage

    backends_mkl_is_available()

    Value

    Returns whether LibTorch is built with MKL support.

    backends_openmp_is_available

    OpenMP is available

    Description

    OpenMP is available

    Usage

    backends_openmp_is_available()

    Value

    Returns whether LibTorch is built with OpenMP support.

  • broadcast_all 23

    broadcast_all Given a list of values (possibly containing numbers), returns a listwhere each value is broadcasted based on the following rules:

    Description

    Raises value_error: if any of the values is not a numeric instance, a torch.*Tensor instance, or aninstance implementing torch_function TODO: add has_torch_function((v,)) See: https://github.com/pytorch/pytorch/blob/master/torch/distributions/utils.py

    Usage

    broadcast_all(values)

    Arguments

    values List of:

    • torch.*Tensor instances are broadcasted as per _broadcasting-semantics.• numeric instances (scalars) are upcast to tensors having the same size and

    type as the first tensor passed to values. If all the values are scalars, thenthey are upcasted to scalar Tensors. values (list of numeric, torch.*Tensoror objects implementing torch_function)

    Constraint Abstract base class for constraints.

    Description

    Abstract base class for constraints.

    Abstract base class for constraints.

    Details

    A constraint object represents a region over which a variable is valid, e.g. within which a variablecan be optimized.

    Methods

    Public methods:• Constraint$check()• Constraint$print()• Constraint$clone()

    Method check(): Returns a byte tensor of sample_shape + batch_shape indicating whethereach event in value satisfies this constraint.

  • 24 cuda_device_count

    Usage:Constraint$check(value)

    Arguments:

    value each event in value will be checked.

    Method print(): Define the print method for constraints,

    Usage:Constraint$print()

    Method clone(): The objects of this class are cloneable with this method.

    Usage:Constraint$clone(deep = FALSE)

    Arguments:

    deep Whether to make a deep clone.

    cuda_current_device Returns the index of a currently selected device.

    Description

    Returns the index of a currently selected device.

    Usage

    cuda_current_device()

    cuda_device_count Returns the number of GPUs available.

    Description

    Returns the number of GPUs available.

    Usage

    cuda_device_count()

  • cuda_is_available 25

    cuda_is_available Returns a bool indicating if CUDA is currently available.

    Description

    Returns a bool indicating if CUDA is currently available.

    Usage

    cuda_is_available()

    dataloader Data loader. Combines a dataset and a sampler, and provides single-or multi-process iterators over the dataset.

    Description

    Data loader. Combines a dataset and a sampler, and provides single- or multi-process iterators overthe dataset.

    Usage

    dataloader(dataset,batch_size = 1,shuffle = FALSE,sampler = NULL,batch_sampler = NULL,num_workers = 0,collate_fn = NULL,pin_memory = FALSE,drop_last = FALSE,timeout = -1,worker_init_fn = NULL,worker_globals = NULL,worker_packages = NULL

    )

    Arguments

    dataset (Dataset): dataset from which to load the data.

    batch_size (int, optional): how many samples per batch to load (default: 1).

    shuffle (bool, optional): set to TRUE to have the data reshuffled at every epoch (default:FALSE).

  • 26 dataloader

    sampler (Sampler, optional): defines the strategy to draw samples from the dataset. Ifspecified, shuffle must be False.

    batch_sampler (Sampler, optional): like sampler, but returns a batch of indices at a time. Mu-tually exclusive with batch_size, shuffle, sampler, and drop_last.

    num_workers (int, optional): how many subprocesses to use for data loading. 0 means that thedata will be loaded in the main process. (default: 0)

    collate_fn (callable, optional): merges a list of samples to form a mini-batch.

    pin_memory (bool, optional): If TRUE, the data loader will copy tensors into CUDA pinnedmemory before returning them. If your data elements are a custom type, or yourcollate_fn returns a batch that is a custom type see the example below.

    drop_last (bool, optional): set to TRUE to drop the last incomplete batch, if the dataset sizeis not divisible by the batch size. If FALSE and the size of dataset is not divisibleby the batch size, then the last batch will be smaller. (default: FALSE)

    timeout (numeric, optional): if positive, the timeout value for collecting a batch fromworkers. -1 means no timeout. (default: -1)

    worker_init_fn (callable, optional): If not NULL, this will be called on each worker subprocesswith the worker id (an int in [1, num_workers]) as input, after seeding and beforedata loading. (default: NULL)

    worker_globals (list or character vector, optional) only used when num_workers > 0. If a charac-ter vector, then objects with those names are copied from the global environmentto the workers. If a named list, then this list is copied and attached to the workerglobal environment. Notice that the objects are copied only once at the workerinitialization.

    worker_packages

    (character vector, optional) Only used if num_workers > 0 optional charactervector naming packages that should be loaded in each worker.

    Parallel data loading

    When using num_workers > 0 data loading will happen in parallel for each worker. Note thatbatches are taken in parallel and not observations.

    The worker initialization process happens in the following order:

    • num_workers R sessions are initialized.

    Then in each worker we perform the following actions:

    • the torch library is loaded.

    • a random seed is set both using set.seed() and using torch_manual_seed.

    • packages passed to the worker_packages argument are loaded.

    • objects passed trough the worker_globals parameters are copied into the global environment.

    • the worker_init function is ran with an id argument.

    • the dataset fetcher is copied to the worker.

  • dataloader_make_iter 27

    dataloader_make_iter Creates an iterator from a DataLoader

    Description

    Creates an iterator from a DataLoader

    Usage

    dataloader_make_iter(dataloader)

    Arguments

    dataloader a dataloader object.

    dataloader_next Get the next element of a dataloader iterator

    Description

    Get the next element of a dataloader iterator

    Usage

    dataloader_next(iter, completed = NULL)

    Arguments

    iter a DataLoader iter created with dataloader_make_iter.

    completed the returned value when the iterator is exhausted.

    dataset Helper function to create an R6 class that inherits from the abstractDataset class

    Description

    All datasets that represent a map from keys to data samples should subclass this class. All subclassesshould overwrite the .getitem() method, which supports fetching a data sample for a given key.Subclasses could also optionally overwrite .length(), which is expected to return the size of thedataset (e.g. number of samples) used by many sampler implementations and the default options ofdataloader().

  • 28 dataset_subset

    Usage

    dataset(name = NULL,inherit = Dataset,...,private = NULL,active = NULL,parent_env = parent.frame()

    )

    Arguments

    name a name for the dataset. It it’s also used as the class for it.inherit you can optionally inherit from a dataset when creating a new dataset.... public methods for the dataset classprivate passed to R6::R6Class().active passed to R6::R6Class().parent_env An environment to use as the parent of newly-created objects.

    Get a batch of observations

    By default datasets are iterated by returning each observation/item individually. Sometimes it’spossible to have an optimized implementation to take a batch of observations (eg, subsetting atensor by multiple indexes at once is faster than subsetting once for each index), in this case youcan implement a .getbatch method that will be used instead of .getitem when getting a batch ofobservations within the dataloader.

    Note

    dataloader() by default constructs a index sampler that yields integral indices. To make it workwith a map-style dataset with non-integral indices/keys, a custom sampler must be provided.

    dataset_subset Dataset Subset

    Description

    Subset of a dataset at specified indices.

    Usage

    dataset_subset(dataset, indices)

    Arguments

    dataset (Dataset): The whole Datasetindices (sequence): Indices in the whole set selected for subset

  • Distribution 29

    Distribution Generic R6 class representing distributions

    Description

    Distribution is the abstract base class for probability distributions. Note: in Python, adding torch.Sizeobjects works as concatenation Try for example: torch.Size((2, 1)) + torch.Size((1,))

    Public fields

    .validate_args whether to validate arguments

    has_rsample whether has an rsample

    has_enumerate_support whether has enumerate support

    Active bindings

    batch_shape Returns the shape over which parameters are batched.

    event_shape Returns the shape of a single sample (without batching). Returns a dictionary fromargument names to torch_Constraint objects that should be satisfied by each argument ofthis distribution. Args that are not tensors need not appear in this dict.

    support Returns a torch_Constraint object representing this distribution’s support.

    mean Returns the mean on of the distribution

    variance Returns the variance of the distribution

    stddev Returns the standard deviation of the distribution TODO: consider different message

    Methods

    Public methods:• Distribution$new()• Distribution$expand()• Distribution$sample()• Distribution$rsample()• Distribution$log_prob()• Distribution$cdf()• Distribution$icdf()• Distribution$enumerate_support()• Distribution$entropy()• Distribution$perplexity()• Distribution$.extended_shape()• Distribution$.validate_sample()• Distribution$print()• Distribution$clone()

  • 30 Distribution

    Method new(): Initializes a distribution class.Usage:Distribution$new(batch_shape = NULL, event_shape = NULL, validate_args = NULL)

    Arguments:

    batch_shape the shape over which parameters are batched.event_shape the shape of a single sample (without batching).validate_args whether to validate the arguments or not. Validation can be time consuming

    so you might want to disable it.

    Method expand(): Returns a new distribution instance (or populates an existing instance pro-vided by a derived class) with batch dimensions expanded to batch_shape. This method callsexpand on the distribution’s parameters. As such, this does not allocate new memory for the ex-panded distribution instance. Additionally, this does not repeat any args checking or parameterbroadcasting in initialize, when an instance is first created.

    Usage:Distribution$expand(batch_shape, .instance = NULL)

    Arguments:

    batch_shape the desired expanded size..instance new instance provided by subclasses that need to override expand.

    Method sample(): Generates a sample_shape shaped sample or sample_shape shaped batchof samples if the distribution parameters are batched.

    Usage:Distribution$sample(sample_shape = NULL)

    Arguments:

    sample_shape the shape you want to sample.

    Method rsample(): Generates a sample_shape shaped reparameterized sample or sample_shapeshaped batch of reparameterized samples if the distribution parameters are batched.

    Usage:Distribution$rsample(sample_shape = NULL)

    Arguments:

    sample_shape the shape you want to sample.

    Method log_prob(): Returns the log of the probability density/mass function evaluated atvalue.

    Usage:Distribution$log_prob(value)

    Arguments:

    value values to evaluate the density on.

    Method cdf(): Returns the cumulative density/mass function evaluated at value.Usage:

  • Distribution 31

    Distribution$cdf(value)

    Arguments:value values to evaluate the density on.

    Method icdf(): Returns the inverse cumulative density/mass function evaluated at value.@description Returns tensor containing all values supported by a discrete distribution. The resultwill enumerate over dimension 0, so the shape of the result will be (cardinality,) + batch_shape + event_shape (where event_shape= ()for univariate distributions). Note that this enumerates over all batched tensors in lock-steplist(c(0,0), c(1, 1), ...). With expand=FALSE, enumeration happens along dim 0, but with the remain-ing batch dimensions being singleton dimensions, list(c(0), c(1), ...)‘.

    Usage:Distribution$icdf(value)

    Arguments:value values to evaluate the density on.

    Method enumerate_support():Usage:Distribution$enumerate_support(expand = TRUE)

    Arguments:expand (bool): whether to expand the support over the batch dims to match the distribution’s

    batch_shape.

    Returns: Tensor iterating over dimension 0.

    Method entropy(): Returns entropy of distribution, batched over batch_shape.Usage:Distribution$entropy()

    Returns: Tensor of shape batch_shape.

    Method perplexity(): Returns perplexity of distribution, batched over batch_shape.Usage:Distribution$perplexity()

    Returns: Tensor of shape batch_shape.

    Method .extended_shape(): Returns the size of the sample returned by the distribution, givena sample_shape. Note, that the batch and event shapes of a distribution instance are fixed at thetime of construction. If this is empty, the returned shape is upcast to (1,).

    Usage:Distribution$.extended_shape(sample_shape = NULL)

    Arguments:sample_shape (torch_Size): the size of the sample to be drawn.

    Method .validate_sample(): Argument validation for distribution methods such as log_prob,cdf and icdf. The rightmost dimensions of a value to be scored via these methods must agreewith the distribution’s batch and event shapes.

  • 32 distr_bernoulli

    Usage:Distribution$.validate_sample(value)

    Arguments:value (Tensor): the tensor whose log probability is to be computed by the log_prob method.

    Method print(): Prints the distribution instance.Usage:Distribution$print()

    Method clone(): The objects of this class are cloneable with this method.Usage:Distribution$clone(deep = FALSE)

    Arguments:deep Whether to make a deep clone.

    distr_bernoulli Creates a Bernoulli distribution parameterized by probs or logits(but not both). Samples are binary (0 or 1). They take the value 1 withprobability p and 0 with probability 1 - p.

    Description

    Creates a Bernoulli distribution parameterized by probs or logits (but not both). Samples arebinary (0 or 1). They take the value 1 with probability p and 0 with probability 1 -p.

    Usage

    distr_bernoulli(probs = NULL, logits = NULL, validate_args = NULL)

    Arguments

    probs (numeric or torch_tensor): the probability of sampling 1logits (numeric or torch_tensor): the log-odds of sampling 1validate_args whether to validate arguments or not.

    See Also

    Distribution for details on the available methods.

    Other distributions: distr_chi2(), distr_gamma(), distr_multivariate_normal(), distr_normal(),distr_poisson()

    Examples

    if (torch_is_installed()) {m

  • distr_categorical 33

    distr_categorical Creates a categorical distribution parameterized by either probs orlogits (but not both).

    Description

    Creates a categorical distribution parameterized by either probs or logits (but not both).

    Usage

    distr_categorical(probs = NULL, logits = NULL, validate_args = NULL)

    Arguments

    probs (Tensor): event probabilities

    logits (Tensor): event log probabilities (unnormalized)

    validate_args Additional arguments

    Note

    It is equivalent to the distribution that torch_multinomial() samples from.

    Samples are integers from {0, . . . ,K − 1} where K is probs$size(-1).

    If probs is 1-dimensional with length-K, each element is the relative probability of sampling theclass at that index.

    If probs is N-dimensional, the first N-1 dimensions are treated as a batch of relative probabilityvectors.

    The probs argument must be non-negative, finite and have a non-zero sum, and it will be normalizedto sum to 1 along the last dimension. attr:probs will return this normalized value. The logitsargument will be interpreted as unnormalized log probabilities and can therefore be any real number.It will likewise be normalized so that the resulting probabilities sum to 1 along the last dimension.attr:logits will return this normalized value.

    See also: torch_multinomial()

    Examples

    if (torch_is_installed()) {m

  • 34 distr_gamma

    distr_chi2 Creates a Chi2 distribution parameterized by shape parameterdf. This is exactly equivalent to distr_gamma(alpha=0.5*df,beta=0.5)

    Description

    Creates a Chi2 distribution parameterized by shape parameter df. This is exactly equivalent todistr_gamma(alpha=0.5*df,beta=0.5)

    Usage

    distr_chi2(df, validate_args = NULL)

    Arguments

    df (float or torch_tensor): shape parameter of the distribution

    validate_args whether to validate arguments or not.

    See Also

    Distribution for details on the available methods.

    Other distributions: distr_bernoulli(), distr_gamma(), distr_multivariate_normal(), distr_normal(),distr_poisson()

    Examples

    if (torch_is_installed()) {m

  • distr_mixture_same_family 35

    Arguments

    concentration (float or Tensor): shape parameter of the distribution (often referred to as alpha)

    rate (float or Tensor): rate = 1 / scale of the distribution (often referred to as beta)

    validate_args whether to validate arguments or not.

    See Also

    Distribution for details on the available methods.

    Other distributions: distr_bernoulli(), distr_chi2(), distr_multivariate_normal(), distr_normal(),distr_poisson()

    Examples

    if (torch_is_installed()) {m

  • 36 distr_multivariate_normal

    component_distribution

    torch_distributions.Distribution-like instance. Right-most batch dimen-sion indexes component.

    validate_args Additional arguments

    Examples

    if (torch_is_installed()) {# Construct Gaussian Mixture Model in 1D consisting of 5 equally# weighted normal distributionsmix

  • distr_normal 37

    Details

    The multivariate normal distribution can be parameterized either in terms of a positive definitecovariance matrix Σ or a positive definite precision matrix Σ−1 or a lower-triangular matrix L withpositive-valued diagonal entries, such that Σ = LL>. This triangular matrix can be obtained viae.g. Cholesky decomposition of the covariance.

    Note

    Only one of covariance_matrix or precision_matrix or scale_tril can be specified. Us-ing scale_tril will be more efficient: all computations internally are based on scale_tril. Ifcovariance_matrix or precision_matrix is passed instead, it is only used to compute the corr


Recommended