diff --git a/dev/articles/examples/basic-nn-module.html b/dev/articles/examples/basic-nn-module.html index 6a2fe20207..dfaa79b78f 100644 --- a/dev/articles/examples/basic-nn-module.html +++ b/dev/articles/examples/basic-nn-module.html @@ -148,9 +148,9 @@ model$parameters
## $w
 ## torch_tensor
-##  0.1865
-## -1.0072
-## -0.3684
+## -0.6771
+## -0.8312
+## -0.9106
 ## [ CPUFloatType{3,1} ][ requires_grad = TRUE ]
 ## 
 ## $b
@@ -161,9 +161,9 @@ 
 # or individually
 model$w
## torch_tensor
-##  0.1865
-## -1.0072
-## -0.3684
+## -0.6771
+## -0.8312
+## -0.9106
 ## [ CPUFloatType{3,1} ][ requires_grad = TRUE ]
 model$b
@@ -178,16 +178,16 @@
 y_pred
## torch_tensor
-##  0.1877
-##  1.6619
-## -1.2566
-## -0.1307
-## -0.8274
-## -0.5725
-## -0.3600
-## -0.3510
-##  0.9889
-## -0.5854
+##  0.2889
+##  0.8299
+##  2.1768
+##  0.7418
+##  1.9289
+## -0.5952
+##  0.3256
+##  0.4967
+##  1.0273
+##  1.0356
 ## [ CPUFloatType{10,1} ][ grad_fn = <AddBackward0> ]
diff --git a/dev/articles/indexing.html b/dev/articles/indexing.html index f9cc2e0201..4fd66bfdb6 100644 --- a/dev/articles/indexing.html +++ b/dev/articles/indexing.html @@ -264,23 +264,23 @@

Getting the complete dimensionx <- torch_randn(2, 3) x #> torch_tensor -#> -0.3052 -0.2663 -0.4936 -#> 0.4514 -0.4122 -0.2530 +#> 0.9608 -0.3748 -0.2395 +#> 0.5306 -0.3664 -2.3445 #> [ CPUFloatType{2,3} ]

The following syntax will give you the first row:

 x[1,]
 #> torch_tensor
-#> -0.3052
-#> -0.2663
-#> -0.4936
+#>  0.9608
+#> -0.3748
+#> -0.2395
 #> [ CPUFloatType{3} ]

And this would give you the first 2 columns:

 x[,1:2]
 #> torch_tensor
-#> -0.3052 -0.2663
-#>  0.4514 -0.4122
+#>  0.9608 -0.3748
+#>  0.5306 -0.3664
 #> [ CPUFloatType{2,2} ]
@@ -362,15 +362,15 @@

Indexing with vectorsx <- torch_randn(4,4) x[c(1,3), c(1,3)] #> torch_tensor -#> 0.4386 0.7013 -#> -0.0037 -1.7523 +#> -0.6921 0.2122 +#> -0.0511 -1.3651 #> [ CPUFloatType{2,2} ]

You can also use boolean vectors, for example:

 x[c(TRUE, FALSE, TRUE, FALSE), c(TRUE, FALSE, TRUE, FALSE)]
 #> torch_tensor
-#>  0.4386  0.7013
-#> -0.0037 -1.7523
+#> -0.6921  0.2122
+#> -0.0511 -1.3651
 #> [ CPUFloatType{2,2} ]

The above examples also work if the index were long or boolean tensors, instead of R vectors. It’s also possible to index with diff --git a/dev/articles/loading-data.html b/dev/articles/loading-data.html index 70ed9c43cf..b6fe74df21 100644 --- a/dev/articles/loading-data.html +++ b/dev/articles/loading-data.html @@ -401,7 +401,7 @@

Training with data loaders cat(sprintf("Loss at epoch %d: %3f\n", epoch, mean(l))) } -#> Loss at epoch 1: 65.852491 +#> Loss at epoch 1: 1864.303545 #> Loss at epoch 2: 2.068251 #> Loss at epoch 3: 2.068251 #> Loss at epoch 4: 2.068251 diff --git a/dev/articles/tensor-creation.html b/dev/articles/tensor-creation.html index 0873cb487e..f478310edf 100644 --- a/dev/articles/tensor-creation.html +++ b/dev/articles/tensor-creation.html @@ -200,11 +200,11 @@

Using creation functionsx <- torch_randn(5, 3) x #> torch_tensor -#> -0.7482 -0.4550 -1.3580 -#> -0.3423 1.4744 0.2369 -#> 1.1909 -0.8298 -1.6119 -#> -1.1493 -0.1692 1.3519 -#> 0.4045 0.8329 0.1382 +#> 0.6068 -0.6024 -0.4282 +#> -0.7771 0.7292 -0.6443 +#> -1.2527 0.2591 -0.4869 +#> -0.7895 1.0399 -0.7958 +#> 1.4962 -0.4263 -0.5192 #> [ CPUFloatType{5,3} ]

Another example is torch_ones, which creates a tensor filled with ones.

diff --git a/dev/articles/torchscript.html b/dev/articles/torchscript.html index c2425f7c6b..4cc264f91b 100644 --- a/dev/articles/torchscript.html +++ b/dev/articles/torchscript.html @@ -172,9 +172,9 @@

Tracing
 traced_fn(torch_randn(3))
 #> torch_tensor
-#>  1.6110
 #>  0.0000
-#>  1.0772
+#>  0.4954
+#>  0.0000
 #> [ CPUFloatType{3} ]

It’s also possible to trace nn_modules() defined in R, for example:

@@ -200,9 +200,9 @@

Tracing
 traced_module(torch_randn(3, 10))
 #> torch_tensor
-#> -0.3029
-#>  0.0101
-#> -0.2558
+#>  0.3633
+#>  0.2271
+#>  0.2926
 #> [ CPUFloatType{3,1} ][ grad_fn = <AddmmBackward0> ]

Limitations of tracing @@ -240,17 +240,17 @@

Limitations of tracingtraced_dropout <- jit_trace(nn_dropout(), torch_ones(5,5)) traced_dropout(torch_ones(3,3)) #> torch_tensor -#> 2 2 2 -#> 0 0 2 #> 0 2 0 +#> 2 0 0 +#> 0 2 2 #> [ CPUFloatType{3,3} ]

 traced_dropout$eval()
 # even after setting to eval mode, dropout is applied
 traced_dropout(torch_ones(3,3))
 #> torch_tensor
-#>  2  2  0
 #>  2  2  2
+#>  2  2  0
 #>  0  0  2
 #> [ CPUFloatType{3,3} ]
    @@ -264,70 +264,70 @@

    Limitations of tracingjit_trace(fn, torch_tensor(1), 1) #> Error in cpp_trace_function(tr_fn, list(...), .compilation_unit, strict, : Only tensors or (possibly nested) dict or tuples of tensors can be inputs to traced functions. Got float #> Exception raised from addInput at /Users/runner/work/pytorch/pytorch/pytorch/torch/csrc/jit/frontend/tracer.cpp:422 (most recent call first): -#> frame #0: c10::Error::Error(c10::SourceLocation, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) + 81 (0x103610ca1 in libc10.dylib) -#> frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 98 (0x10360f342 in libc10.dylib) -#> frame #2: torch::jit::tracer::addInput(std::__1::shared_ptr<torch::jit::tracer::TracingState> const&, c10::IValue const&, c10::Type::SingletonOrSharedTypePtr<c10::Type> const&, torch::jit::Value*) + 6052 (0x125661564 in libtorch_cpu.dylib) -#> frame #3: torch::jit::tracer::addInput(std::__1::shared_ptr<torch::jit::tracer::TracingState> const&, c10::IValue const&, c10::Type::SingletonOrSharedTypePtr<c10::Type> const&, torch::jit::Value*) + 4445 (0x125660f1d in libtorch_cpu.dylib) -#> frame #4: torch::jit::tracer::trace(std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>>, std::__1::function<std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>> (std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>>)> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> (at::Tensor const&)>, bool, bool, torch::jit::Module*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) + 826 (0x12565e59a in libtorch_cpu.dylib) -#> frame #5: _lantern_trace_fn + 597 (0x1080f2b35 in liblantern.dylib) -#> frame #6: cpp_trace_function(Rcpp::Function_Impl<Rcpp::PreserveStorage>, XPtrTorchStack, XPtrTorchCompilationUnit, XPtrTorchstring, bool, XPtrTorchScriptModule, bool, bool) + 566 (0x106298176 in torchpkg.so) -#> frame #7: _torch_cpp_trace_function + 719 (0x1060d2acf in torchpkg.so) -#> frame #8: R_doDotCall + 13245 (0x10091c8fd in libR.dylib) -#> frame #9: bcEval_loop + 146643 (0x100984593 in libR.dylib) -#> frame #10: bcEval + 628 (0x100952234 in libR.dylib) -#> frame #11: Rf_eval + 506 (0x10095193a in libR.dylib) -#> frame #12: R_execClosure + 761 (0x100954479 in libR.dylib) -#> frame #13: applyClosure_core + 128 (0x100953580 in libR.dylib) -#> frame #14: Rf_eval + 1189 (0x100951be5 in libR.dylib) -#> frame #15: do_eval + 1253 (0x100958fa5 in libR.dylib) -#> frame #16: bcEval_loop + 44476 (0x10096b67c in libR.dylib) -#> frame #17: bcEval + 628 (0x100952234 in libR.dylib) -#> frame #18: Rf_eval + 506 (0x10095193a in libR.dylib) -#> frame #19: forcePromise + 230 (0x100952466 in libR.dylib) -#> frame #20: Rf_eval + 634 (0x1009519ba in libR.dylib) -#> frame #21: do_withVisible + 57 (0x100959339 in libR.dylib) -#> frame #22: do_internal + 362 (0x1009d0fea in libR.dylib) -#> frame #23: bcEval_loop + 45103 (0x10096b8ef in libR.dylib) -#> frame #24: bcEval + 628 (0x100952234 in libR.dylib) -#> frame #25: Rf_eval + 506 (0x10095193a in libR.dylib) -#> frame #26: R_execClosure + 761 (0x100954479 in libR.dylib) -#> frame #27: applyClosure_core + 128 (0x100953580 in libR.dylib) -#> frame #28: Rf_eval + 1189 (0x100951be5 in libR.dylib) -#> frame #29: do_begin + 429 (0x100956e6d in libR.dylib) -#> frame #30: Rf_eval + 990 (0x100951b1e in libR.dylib) -#> frame #31: R_execClosure + 761 (0x100954479 in libR.dylib) -#> frame #32: applyClosure_core + 128 (0x100953580 in libR.dylib) -#> frame #33: Rf_eval + 1189 (0x100951be5 in libR.dylib) -#> frame #34: do_docall + 615 (0x1008e26e7 in libR.dylib) -#> frame #35: bcEval_loop + 44476 (0x10096b67c in libR.dylib) -#> frame #36: bcEval + 628 (0x100952234 in libR.dylib) -#> frame #37: Rf_eval + 506 (0x10095193a in libR.dylib) -#> frame #38: R_execClosure + 761 (0x100954479 in libR.dylib) -#> frame #39: applyClosure_core + 128 (0x100953580 in libR.dylib) -#> frame #40: Rf_eval + 1189 (0x100951be5 in libR.dylib) -#> frame #41: do_docall + 615 (0x1008e26e7 in libR.dylib) -#> frame #42: bcEval_loop + 44476 (0x10096b67c in libR.dylib) -#> frame #43: bcEval + 628 (0x100952234 in libR.dylib) -#> frame #44: Rf_eval + 506 (0x10095193a in libR.dylib) -#> frame #45: R_execClosure + 761 (0x100954479 in libR.dylib) -#> frame #46: applyClosure_core + 128 (0x100953580 in libR.dylib) -#> frame #47: Rf_eval + 1189 (0x100951be5 in libR.dylib) -#> frame #48: forcePromise + 230 (0x100952466 in libR.dylib) -#> frame #49: bcEval_loop + 19496 (0x1009654e8 in libR.dylib) -#> frame #50: bcEval + 628 (0x100952234 in libR.dylib) -#> frame #51: Rf_eval + 506 (0x10095193a in libR.dylib) -#> frame #52: R_execClosure + 761 (0x100954479 in libR.dylib) -#> frame #53: applyClosure_core + 128 (0x100953580 in libR.dylib) -#> frame #54: Rf_eval + 1189 (0x100951be5 in libR.dylib) -#> frame #55: do_begin + 429 (0x100956e6d in libR.dylib) -#> frame #56: Rf_eval + 990 (0x100951b1e in libR.dylib) -#> frame #57: forcePromise + 230 (0x100952466 in libR.dylib) -#> frame #58: bcEval_loop + 19496 (0x1009654e8 in libR.dylib) -#> frame #59: bcEval + 628 (0x100952234 in libR.dylib) -#> frame #60: Rf_eval + 506 (0x10095193a in libR.dylib) -#> frame #61: R_execClosure + 761 (0x100954479 in libR.dylib) -#> frame #62: applyClosure_core + 128 (0x100953580 in libR.dylib) -#> frame #63: Rf_eval + 1189 (0x100951be5 in libR.dylib) +#> frame #0: c10::Error::Error(c10::SourceLocation, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) + 81 (0x10e936ca1 in libc10.dylib) +#> frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 98 (0x10e935342 in libc10.dylib) +#> frame #2: torch::jit::tracer::addInput(std::__1::shared_ptr<torch::jit::tracer::TracingState> const&, c10::IValue const&, c10::Type::SingletonOrSharedTypePtr<c10::Type> const&, torch::jit::Value*) + 6052 (0x130987564 in libtorch_cpu.dylib) +#> frame #3: torch::jit::tracer::addInput(std::__1::shared_ptr<torch::jit::tracer::TracingState> const&, c10::IValue const&, c10::Type::SingletonOrSharedTypePtr<c10::Type> const&, torch::jit::Value*) + 4445 (0x130986f1d in libtorch_cpu.dylib) +#> frame #4: torch::jit::tracer::trace(std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>>, std::__1::function<std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>> (std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>>)> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> (at::Tensor const&)>, bool, bool, torch::jit::Module*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) + 826 (0x13098459a in libtorch_cpu.dylib) +#> frame #5: _lantern_trace_fn + 597 (0x113418b35 in liblantern.dylib) +#> frame #6: cpp_trace_function(Rcpp::Function_Impl<Rcpp::PreserveStorage>, XPtrTorchStack, XPtrTorchCompilationUnit, XPtrTorchstring, bool, XPtrTorchScriptModule, bool, bool) + 566 (0x1115be176 in torchpkg.so) +#> frame #7: _torch_cpp_trace_function + 719 (0x1113f8b0f in torchpkg.so) +#> frame #8: R_doDotCall + 13245 (0x10bc428fd in libR.dylib) +#> frame #9: bcEval_loop + 146643 (0x10bcaa593 in libR.dylib) +#> frame #10: bcEval + 628 (0x10bc78234 in libR.dylib) +#> frame #11: Rf_eval + 506 (0x10bc7793a in libR.dylib) +#> frame #12: R_execClosure + 761 (0x10bc7a479 in libR.dylib) +#> frame #13: applyClosure_core + 128 (0x10bc79580 in libR.dylib) +#> frame #14: Rf_eval + 1189 (0x10bc77be5 in libR.dylib) +#> frame #15: do_eval + 1253 (0x10bc7efa5 in libR.dylib) +#> frame #16: bcEval_loop + 44476 (0x10bc9167c in libR.dylib) +#> frame #17: bcEval + 628 (0x10bc78234 in libR.dylib) +#> frame #18: Rf_eval + 506 (0x10bc7793a in libR.dylib) +#> frame #19: forcePromise + 230 (0x10bc78466 in libR.dylib) +#> frame #20: Rf_eval + 634 (0x10bc779ba in libR.dylib) +#> frame #21: do_withVisible + 57 (0x10bc7f339 in libR.dylib) +#> frame #22: do_internal + 362 (0x10bcf6fea in libR.dylib) +#> frame #23: bcEval_loop + 45103 (0x10bc918ef in libR.dylib) +#> frame #24: bcEval + 628 (0x10bc78234 in libR.dylib) +#> frame #25: Rf_eval + 506 (0x10bc7793a in libR.dylib) +#> frame #26: R_execClosure + 761 (0x10bc7a479 in libR.dylib) +#> frame #27: applyClosure_core + 128 (0x10bc79580 in libR.dylib) +#> frame #28: Rf_eval + 1189 (0x10bc77be5 in libR.dylib) +#> frame #29: do_begin + 429 (0x10bc7ce6d in libR.dylib) +#> frame #30: Rf_eval + 990 (0x10bc77b1e in libR.dylib) +#> frame #31: R_execClosure + 761 (0x10bc7a479 in libR.dylib) +#> frame #32: applyClosure_core + 128 (0x10bc79580 in libR.dylib) +#> frame #33: Rf_eval + 1189 (0x10bc77be5 in libR.dylib) +#> frame #34: do_docall + 615 (0x10bc086e7 in libR.dylib) +#> frame #35: bcEval_loop + 44476 (0x10bc9167c in libR.dylib) +#> frame #36: bcEval + 628 (0x10bc78234 in libR.dylib) +#> frame #37: Rf_eval + 506 (0x10bc7793a in libR.dylib) +#> frame #38: R_execClosure + 761 (0x10bc7a479 in libR.dylib) +#> frame #39: applyClosure_core + 128 (0x10bc79580 in libR.dylib) +#> frame #40: Rf_eval + 1189 (0x10bc77be5 in libR.dylib) +#> frame #41: do_docall + 615 (0x10bc086e7 in libR.dylib) +#> frame #42: bcEval_loop + 44476 (0x10bc9167c in libR.dylib) +#> frame #43: bcEval + 628 (0x10bc78234 in libR.dylib) +#> frame #44: Rf_eval + 506 (0x10bc7793a in libR.dylib) +#> frame #45: R_execClosure + 761 (0x10bc7a479 in libR.dylib) +#> frame #46: applyClosure_core + 128 (0x10bc79580 in libR.dylib) +#> frame #47: Rf_eval + 1189 (0x10bc77be5 in libR.dylib) +#> frame #48: forcePromise + 230 (0x10bc78466 in libR.dylib) +#> frame #49: bcEval_loop + 19496 (0x10bc8b4e8 in libR.dylib) +#> frame #50: bcEval + 628 (0x10bc78234 in libR.dylib) +#> frame #51: Rf_eval + 506 (0x10bc7793a in libR.dylib) +#> frame #52: R_execClosure + 761 (0x10bc7a479 in libR.dylib) +#> frame #53: applyClosure_core + 128 (0x10bc79580 in libR.dylib) +#> frame #54: Rf_eval + 1189 (0x10bc77be5 in libR.dylib) +#> frame #55: do_begin + 429 (0x10bc7ce6d in libR.dylib) +#> frame #56: Rf_eval + 990 (0x10bc77b1e in libR.dylib) +#> frame #57: forcePromise + 230 (0x10bc78466 in libR.dylib) +#> frame #58: bcEval_loop + 19496 (0x10bc8b4e8 in libR.dylib) +#> frame #59: bcEval + 628 (0x10bc78234 in libR.dylib) +#> frame #60: Rf_eval + 506 (0x10bc7793a in libR.dylib) +#> frame #61: R_execClosure + 761 (0x10bc7a479 in libR.dylib) +#> frame #62: applyClosure_core + 128 (0x10bc79580 in libR.dylib) +#> frame #63: Rf_eval + 1189 (0x10bc77be5 in libR.dylib) #> : diff --git a/dev/articles/using-autograd.html b/dev/articles/using-autograd.html index fc87acdb10..98e098175f 100644 --- a/dev/articles/using-autograd.html +++ b/dev/articles/using-autograd.html @@ -307,26 +307,26 @@

    The simple network, now using aut }) } -#> 10 41.89831 -#> 20 39.4831 -#> 30 37.25135 -#> 40 35.19019 -#> 50 33.27463 -#> 60 31.49398 -#> 70 29.84103 -#> 80 28.30009 -#> 90 26.86458 -#> 100 25.52304 -#> 110 24.27102 -#> 120 23.10262 -#> 130 22.01185 -#> 140 20.99446 -#> 150 20.04303 -#> 160 19.15331 -#> 170 18.32094 -#> 180 17.54308 -#> 190 16.81508 -#> 200 16.13168 +#> 10 32.38971 +#> 20 30.48063 +#> 30 28.7337 +#> 40 27.12838 +#> 50 25.65293 +#> 60 24.30042 +#> 70 23.06005 +#> 80 21.92128 +#> 90 20.87608 +#> 100 19.91491 +#> 110 19.0266 +#> 120 18.20663 +#> 130 17.45047 +#> 140 16.75254 +#> 150 16.10718 +#> 160 15.50757 +#> 170 14.95277 +#> 180 14.43931 +#> 190 13.96377 +#> 200 13.52108

    We still manually compute the forward pass, and we still manually update the weights. In the last two chapters of this section, we’ll see how these parts of the logic can be made more modular and reusable, as diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index dee9784413..fe1637c531 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -20,7 +20,7 @@ articles: tensor-creation: tensor-creation.html torchscript: torchscript.html using-autograd: using-autograd.html -last_built: 2024-06-20T12:34Z +last_built: 2024-06-20T13:28Z urls: reference: https://torch.mlverse.org/docs/reference article: https://torch.mlverse.org/docs/articles diff --git a/dev/reference/distr_bernoulli.html b/dev/reference/distr_bernoulli.html index 736ef194e3..551750aec0 100644 --- a/dev/reference/distr_bernoulli.html +++ b/dev/reference/distr_bernoulli.html @@ -134,7 +134,7 @@

    Examplesm$sample() # 30% chance 1; 70% chance 0 } #> torch_tensor -#> 0 +#> 1 #> [ CPUFloatType{1} ] diff --git a/dev/reference/distr_categorical.html b/dev/reference/distr_categorical.html index 695d96eada..aed2558681 100644 --- a/dev/reference/distr_categorical.html +++ b/dev/reference/distr_categorical.html @@ -136,7 +136,7 @@

    Examplesm$sample() # equal probability of 1,2,3,4 } #> torch_tensor -#> 4 +#> 2 #> [ CPULongType{} ] diff --git a/dev/reference/distr_gamma.html b/dev/reference/distr_gamma.html index 15ae6af9e2..b4220b738b 100644 --- a/dev/reference/distr_gamma.html +++ b/dev/reference/distr_gamma.html @@ -127,8 +127,7 @@

    Examplesm$sample() # Gamma distributed with concentration=1 and rate=1 } #> torch_tensor -#> 0.01 * -#> 6.2671 +#> 0.8966 #> [ CPUFloatType{1} ] diff --git a/dev/reference/distr_multivariate_normal.html b/dev/reference/distr_multivariate_normal.html index 6c5b3e6132..2d10b15964 100644 --- a/dev/reference/distr_multivariate_normal.html +++ b/dev/reference/distr_multivariate_normal.html @@ -161,8 +161,8 @@

    Examplesm$sample() # normally distributed with mean=`[0,0]` and covariance_matrix=`I` } #> torch_tensor -#> 0.3098 -#> -0.1572 +#> -0.9119 +#> 0.5310 #> [ CPUFloatType{2} ] diff --git a/dev/reference/distr_normal.html b/dev/reference/distr_normal.html index 847de17eec..6bb01fb1a5 100644 --- a/dev/reference/distr_normal.html +++ b/dev/reference/distr_normal.html @@ -134,7 +134,8 @@

    Examplesm$sample() # normally distributed with loc=0 and scale=1 } #> torch_tensor -#> -0.2190 +#> 0.01 * +#> -6.2527 #> [ CPUFloatType{1} ] diff --git a/dev/reference/distr_poisson.html b/dev/reference/distr_poisson.html index 4b65660b95..f8ac46eced 100644 --- a/dev/reference/distr_poisson.html +++ b/dev/reference/distr_poisson.html @@ -130,7 +130,7 @@

    Examplesm$sample() } #> torch_tensor -#> 0 +#> 1 #> [ CPUFloatType{1} ] diff --git a/dev/reference/jit_compile.html b/dev/reference/jit_compile.html index fb603643eb..ac21ba1ade 100644 --- a/dev/reference/jit_compile.html +++ b/dev/reference/jit_compile.html @@ -119,7 +119,7 @@

    Examplescomp$foo(torch_randn(10)) } #> torch_tensor -#> 1.25498 +#> -2.43871 #> [ CPUFloatType{} ] diff --git a/dev/reference/linalg_cholesky_ex.html b/dev/reference/linalg_cholesky_ex.html index 70406a3ec5..f7687e1c31 100644 --- a/dev/reference/linalg_cholesky_ex.html +++ b/dev/reference/linalg_cholesky_ex.html @@ -194,8 +194,8 @@

    Examples} #> $L #> torch_tensor -#> -0.4827 0.0000 -#> 0.9156 -2.2141 +#> -1.1693 0.0000 +#> 0.3364 -0.1002 #> [ CPUFloatType{2,2} ] #> #> $info diff --git a/dev/reference/linalg_det.html b/dev/reference/linalg_det.html index b3b99bfda8..9f68fc5722 100644 --- a/dev/reference/linalg_det.html +++ b/dev/reference/linalg_det.html @@ -145,9 +145,9 @@

    Exampleslinalg_det(a) } #> torch_tensor -#> 0.1197 -#> -0.0739 -#> 4.9861 +#> -0.6954 +#> 8.2102 +#> -0.5918 #> [ CPUFloatType{3} ] diff --git a/dev/reference/linalg_eigh.html b/dev/reference/linalg_eigh.html index 3f4ee25724..f768c9cec4 100644 --- a/dev/reference/linalg_eigh.html +++ b/dev/reference/linalg_eigh.html @@ -212,14 +212,14 @@

    Examples} #> [[1]] #> torch_tensor -#> -0.9654 -#> 1.9518 +#> -0.0631 +#> 1.8944 #> [ CPUFloatType{2} ] #> #> [[2]] #> torch_tensor -#> 0.5843 -0.8116 -#> -0.8116 -0.5843 +#> 0.6145 -0.7889 +#> -0.7889 -0.6145 #> [ CPUFloatType{2,2} ] #> diff --git a/dev/reference/linalg_eigvalsh.html b/dev/reference/linalg_eigvalsh.html index 3d7703eb63..2a14981785 100644 --- a/dev/reference/linalg_eigvalsh.html +++ b/dev/reference/linalg_eigvalsh.html @@ -171,8 +171,8 @@

    Exampleslinalg_eigvalsh(a) } #> torch_tensor -#> -1.2070 -#> 0.9306 +#> -2.1658 +#> -0.3751 #> [ CPUFloatType{2} ] diff --git a/dev/reference/linalg_inv.html b/dev/reference/linalg_inv.html index d31f889157..ad4197e989 100644 --- a/dev/reference/linalg_inv.html +++ b/dev/reference/linalg_inv.html @@ -160,10 +160,10 @@

    Exampleslinalg_inv(A) } #> torch_tensor -#> -0.4680 1.2965 0.1748 -0.0531 -#> -0.7830 0.6956 0.3900 -0.6636 -#> 0.7273 -1.5597 0.0351 0.8387 -#> 0.3854 -0.4458 0.1884 -0.1574 +#> 0.3685 0.4104 -0.9437 1.1922 +#> 0.1241 0.3116 0.2464 0.1090 +#> -1.2794 -0.3316 0.0205 0.4999 +#> -0.7428 -0.4627 0.7103 0.3605 #> [ CPUFloatType{4,4} ] diff --git a/dev/reference/linalg_pinv.html b/dev/reference/linalg_pinv.html index 7e32970385..22df662954 100644 --- a/dev/reference/linalg_pinv.html +++ b/dev/reference/linalg_pinv.html @@ -193,11 +193,11 @@

    Exampleslinalg_pinv(A) } #> torch_tensor -#> -0.5330 -0.1832 -0.1170 -#> -0.5486 0.2606 -0.2353 -#> -0.1460 -0.1012 0.1620 -#> -0.2810 -0.1273 -0.2596 -#> 0.1758 0.0326 -0.3221 +#> -0.3009 -0.0044 -0.0113 +#> -0.0146 0.2801 -0.0678 +#> -0.0285 0.2121 -0.1871 +#> -0.4090 0.1417 -0.1749 +#> 0.3333 -0.1673 -0.6218 #> [ CPUFloatType{5,3} ] diff --git a/dev/reference/linalg_slogdet.html b/dev/reference/linalg_slogdet.html index 0d9b94d801..19a6257db3 100644 --- a/dev/reference/linalg_slogdet.html +++ b/dev/reference/linalg_slogdet.html @@ -164,12 +164,12 @@

    Examples} #> [[1]] #> torch_tensor -#> 1 +#> -1 #> [ CPUFloatType{} ] #> #> [[2]] #> torch_tensor -#> 0.00597543 +#> 2.32642 #> [ CPUFloatType{} ] #> diff --git a/dev/reference/linalg_svd.html b/dev/reference/linalg_svd.html index dce13dba3c..053097546a 100644 --- a/dev/reference/linalg_svd.html +++ b/dev/reference/linalg_svd.html @@ -221,25 +221,25 @@

    Examples} #> [[1]] #> torch_tensor -#> -0.3092 -0.7998 0.0359 -#> -0.0535 -0.2031 -0.2685 -#> 0.8818 -0.2241 -0.3585 -#> -0.2574 0.4594 -0.5845 -#> 0.2403 0.2404 0.6756 +#> 0.1800 -0.4603 -0.3745 +#> -0.1581 0.3156 -0.9104 +#> 0.8789 -0.1714 -0.1345 +#> 0.3674 0.8086 0.1136 +#> -0.1875 0.0731 0.0001 #> [ CPUFloatType{5,3} ] #> #> [[2]] #> torch_tensor -#> 3.3773 -#> 1.3341 -#> 0.7216 +#> 4.3759 +#> 2.7956 +#> 1.1670 #> [ CPUFloatType{3} ] #> #> [[3]] #> torch_tensor -#> -0.6477 0.3395 0.6821 -#> 0.2975 0.9368 -0.1838 -#> 0.7014 -0.0839 0.7078 +#> 0.4414 -0.8969 0.0267 +#> 0.8854 0.4305 -0.1755 +#> 0.1459 0.1011 0.9841 #> [ CPUFloatType{3,3} ] #> diff --git a/dev/reference/linalg_svdvals.html b/dev/reference/linalg_svdvals.html index 104ece639b..7d9d0b82b7 100644 --- a/dev/reference/linalg_svdvals.html +++ b/dev/reference/linalg_svdvals.html @@ -153,9 +153,9 @@

    ExamplesS } #> torch_tensor -#> 3.4688 -#> 2.1754 -#> 1.3432 +#> 2.1894 +#> 1.5609 +#> 0.8563 #> [ CPUFloatType{3} ] diff --git a/dev/reference/linalg_tensorsolve.html b/dev/reference/linalg_tensorsolve.html index a0d63d2c89..e500571069 100644 --- a/dev/reference/linalg_tensorsolve.html +++ b/dev/reference/linalg_tensorsolve.html @@ -171,7 +171,7 @@

    ExamplesA <- A$permute(c(2, 4, 5, 1, 3)) torch_allclose(torch_tensordot(A, X, dims = X$ndim), B, atol = 1e-6) } -#> [1] FALSE +#> [1] TRUE