Performs a batch matrix-matrix product of matrices stored in batch1 and batch2.

tch_bmm(x, mat2)

Examples

x <- tensor(array(runif(120), dim = c(10, 3, 4))) y <- tensor(array(runif(200), dim = c(10, 4, 5))) tch_bmm(x, y)
#> tensor #> (1,.,.) = #> 0.6293 1.0020 0.7352 0.5210 0.9231 #> 0.3141 0.5501 0.7251 0.9344 1.2766 #> 0.9830 1.2543 1.1360 0.7354 1.1950 #> #> (2,.,.) = #> 1.8325 0.9647 0.6807 1.6230 0.8114 #> 1.8418 1.2336 0.7622 1.8304 1.2863 #> 2.2555 1.4223 1.0190 2.1697 1.5272 #> #> (3,.,.) = #> 0.8469 0.8787 0.8935 1.1297 0.6538 #> 1.1895 1.1894 1.1817 1.4238 0.8693 #> 0.6393 0.6778 0.6127 0.9600 0.3914 #> #> (4,.,.) = #> 0.7274 0.8827 0.5261 0.5920 1.4687 #> 0.8544 1.4958 0.8707 1.0292 1.8769 #> 1.0663 1.7649 1.1979 0.6717 2.0184 #> #> (5,.,.) = #> 0.4358 0.5210 0.7528 0.6967 1.1019 #> 1.1670 0.8800 1.4630 1.2074 0.8799 #> 1.3217 1.1118 1.4216 1.6463 1.2123 #> #> (6,.,.) = #> 0.6915 0.4908 0.6393 0.2888 0.3655 #> 0.7859 0.5334 0.7251 0.3310 0.5026 #> 1.0086 0.7153 1.0395 0.4569 0.4747 #> #> (7,.,.) = #> 1.5859 1.9309 2.1541 1.8878 1.9247 #> 0.7388 0.7639 1.1895 1.1351 1.3757 #> 0.3077 0.2153 0.3142 0.3001 0.9953 #> #> (8,.,.) = #> 0.6038 0.5623 0.7072 0.3136 0.7693 #> 2.0329 1.8815 1.5762 1.0852 1.6774 #> 0.9740 0.8466 0.9212 0.5174 0.8916 #> #> (9,.,.) = #> 0.5911 0.8112 0.5853 0.3118 0.6590 #> 0.5841 0.5470 0.8027 0.4062 0.6243 #> 1.0840 1.0529 1.4977 1.0611 0.9546 #> #> (10,.,.) = #> 0.9435 0.5682 1.4403 1.0301 1.8130 #> 1.1059 1.1706 2.1263 1.3860 2.4489 #> 0.3318 0.6422 0.9106 0.5967 0.9721 #> [ Variable[CPUFloatType]{10,3,5} ]