mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Fixed Tensor documentation formatting.
This commit is contained in:
parent
15f3d9d272
commit
c694be1214
@ -1636,8 +1636,8 @@ For example, given the following input tensor:
|
||||
{8.0f, 9.0f, 10.0f, 11.0f}});
|
||||
|
||||
cout << "tensor: " << endl << tensor << endl;
|
||||
=>
|
||||
tensor:
|
||||
=>
|
||||
tensor:
|
||||
0 1 2 3
|
||||
4 5 6 7
|
||||
8 9 10 11
|
||||
@ -1665,46 +1665,46 @@ Six 2x2 patches can be extracted and indexed using the following code:
|
||||
|
||||
This code results in the following output when the data layout is ColMajor:
|
||||
|
||||
patch index: 0
|
||||
0 1
|
||||
4 5
|
||||
patch index: 1
|
||||
4 5
|
||||
8 9
|
||||
patch index: 2
|
||||
1 2
|
||||
5 6
|
||||
patch index: 3
|
||||
5 6
|
||||
9 10
|
||||
patch index: 4
|
||||
2 3
|
||||
6 7
|
||||
patch index: 5
|
||||
6 7
|
||||
10 11
|
||||
patch index: 0
|
||||
0 1
|
||||
4 5
|
||||
patch index: 1
|
||||
4 5
|
||||
8 9
|
||||
patch index: 2
|
||||
1 2
|
||||
5 6
|
||||
patch index: 3
|
||||
5 6
|
||||
9 10
|
||||
patch index: 4
|
||||
2 3
|
||||
6 7
|
||||
patch index: 5
|
||||
6 7
|
||||
10 11
|
||||
|
||||
This code results in the following output when the data layout is RowMajor:
|
||||
(NOTE: the set of patches is the same as in ColMajor, but are indexed differently).
|
||||
|
||||
patch index: 0
|
||||
0 1
|
||||
4 5
|
||||
patch index: 1
|
||||
1 2
|
||||
5 6
|
||||
patch index: 2
|
||||
2 3
|
||||
6 7
|
||||
patch index: 3
|
||||
4 5
|
||||
8 9
|
||||
patch index: 4
|
||||
5 6
|
||||
9 10
|
||||
patch index: 5
|
||||
6 7
|
||||
10 11
|
||||
patch index: 0
|
||||
0 1
|
||||
4 5
|
||||
patch index: 1
|
||||
1 2
|
||||
5 6
|
||||
patch index: 2
|
||||
2 3
|
||||
6 7
|
||||
patch index: 3
|
||||
4 5
|
||||
8 9
|
||||
patch index: 4
|
||||
5 6
|
||||
9 10
|
||||
patch index: 5
|
||||
6 7
|
||||
10 11
|
||||
|
||||
### `<Operation> extract_image_patches(const Index patch_rows, const Index patch_cols, const Index row_stride, const Index col_stride, const PaddingType padding_type)`
|
||||
|
||||
@ -1742,6 +1742,7 @@ sizes:
|
||||
2x2 image patches can be extracted and indexed using the following code:
|
||||
|
||||
*) 2D patch: ColMajor (patch indexed by second-to-last dimension)
|
||||
|
||||
Tensor<float, 5> twod_patch;
|
||||
twod_patch = tensor.extract_image_patches<2, 2>();
|
||||
// twod_patch.dimension(0) == 2
|
||||
@ -1751,6 +1752,7 @@ sizes:
|
||||
// twod_patch.dimension(4) == 7
|
||||
|
||||
*) 2D patch: RowMajor (patch indexed by the second dimension)
|
||||
|
||||
Tensor<float, 5, RowMajor> twod_patch_row_major;
|
||||
twod_patch_row_major = tensor_row_major.extract_image_patches<2, 2>();
|
||||
// twod_patch_row_major.dimension(0) == 7
|
||||
|
Loading…
x
Reference in New Issue
Block a user