You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `weights_` is an optional parameter, represents array of weights for observations (of size `n_observations`). If the parameter is not specified, each observation is assigned a weight equal 1.
106
-
* `indices_` is an optional parameter, represents array of dimensions that are processed (of size `n_dims`). If the parameter is not specified, all dimensions are processed.
102
+
* `weights_` is an optional parameter, represents an array of weights for observations (of size `n_observations`). If the parameter is not specified, each observation is assigned a weight equal 1.
103
+
* `indices_` is an optional parameter, represents an array of dimensions that are processed (of size `n_dims`). If the parameter is not specified, all dimensions are processed.
* `weights_` is an optional parameter, represents array of weights for observations (of size `n_observations`). If the parameter is not specified, each observation is assigned a weight equal 1.
201
-
* `indices_` is an optional parameter, represents array of dimensions that are processed (of size `n_dims`). If the parameter is not specified, all dimensions are processed.
194
+
* `weights_` is an optional parameter, represents an array of weights for observations (of size `n_observations`). If the parameter is not specified, each observation is assigned a weight equal 1.
195
+
* `indices_` is an optional parameter, represents an array of dimensions that are processed (of size `n_dims`). If the parameter is not specified, all dimensions are processed.
Copy file name to clipboardExpand all lines: source/elements/oneMKL/source/domains/stats/onemkl_stats_usage_model.rst
+11-71Lines changed: 11 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,92 +20,32 @@ A typical algorithm for summary statistics is as follows:
20
20
The following example demonstrates how to calculate mean values for a 3-dimensional dataset filled with random numbers. For dataset creation, the :ref:`onemkl_stats_make_dataset` helper function is used.
21
21
22
22
23
-
Buffer-based example
24
-
--------------------
25
-
26
-
.. code-block:: cpp
27
-
28
-
#include <iostream>
29
-
#include <vector>
30
-
31
-
#include "CL/sycl.hpp"
32
-
#include "oneapi/mkl/stats.hpp"
33
-
34
-
int main() {
35
-
sycl::queue queue;
36
-
37
-
const size_t n_observations = 1000;
38
-
const size_t n_dims = 3;
39
-
std::vector<float> x(n_observations * n_dims);
40
-
// fill x storage with random numbers
41
-
for(int i = 0; i < n_dims, i++) {
42
-
for(int j = 0; j < n_observations; j++) {
43
-
x[j + i * n_observations] = float(std::rand()) / float(RAND_MAX);
44
-
}
45
-
}
46
-
//create buffer for dataset
47
-
sycl::buffer<float, 1> x_buf(x.data(), x.size());
48
-
// create buffer for mean values
49
-
sycl::buffer<float, 1> mean_buf(n_dims);
50
-
// create oneapi::mkl::stats::dataset
51
-
auto dataset = oneapi::mkl::stats::make_dataset<oneapi::mkl::stats::layout::row_major>(n_dims, n_observations, x_buf);
0 commit comments