mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-07 05:31:48 +08:00
Fix docs build.
This commit is contained in:
parent
f169c13d8e
commit
cc0be00435
@ -92,7 +92,7 @@ TensorMap<Tensor<float, 1>> t_12(t_4x3.data(), 12);
|
|||||||
|
|
||||||
#### Class TensorRef
|
#### Class TensorRef
|
||||||
|
|
||||||
See [Assigning to a TensorRef.](#assigning-to-a-tensorref)
|
See **Assigning to a `TensorRef`**.
|
||||||
|
|
||||||
## Accessing Tensor Elements
|
## Accessing Tensor Elements
|
||||||
|
|
||||||
@ -602,8 +602,8 @@ std::cout << "Size: " << a.size();
|
|||||||
A few operations provide `dimensions()` directly,
|
A few operations provide `dimensions()` directly,
|
||||||
e.g. `TensorReslicingOp`. Most operations defer calculating dimensions
|
e.g. `TensorReslicingOp`. Most operations defer calculating dimensions
|
||||||
until the operation is being evaluated. If you need access to the dimensions
|
until the operation is being evaluated. If you need access to the dimensions
|
||||||
of a deferred operation, you can wrap it in a TensorRef (see
|
of a deferred operation, you can wrap it in a `TensorRef` (see
|
||||||
[Assigning to a TensorRef.](#assigning-to-a-tensorref)), which provides
|
**Assigning to a TensorRef** above), which provides
|
||||||
`dimensions()` and `dimension()` as above.
|
`dimensions()` and `dimension()` as above.
|
||||||
|
|
||||||
`TensorRef` can also wrap the plain `Tensor` types, so this is a useful idiom in
|
`TensorRef` can also wrap the plain `Tensor` types, so this is a useful idiom in
|
||||||
@ -635,7 +635,7 @@ is not initialized.
|
|||||||
Eigen::TensorFixedSize<float, Sizes<3, 4>> a;
|
Eigen::TensorFixedSize<float, Sizes<3, 4>> a;
|
||||||
std::cout << "Rank: " << a.rank() << endl;
|
std::cout << "Rank: " << a.rank() << endl;
|
||||||
// Rank: 2
|
// Rank: 2
|
||||||
std::cout << "NumRows: " << a.dimension(0)
|
std::cout << "NumRows: " << a.dimension(0)
|
||||||
<< " NumCols: " << a.dimension(1) << endl;
|
<< " NumCols: " << a.dimension(1) << endl;
|
||||||
// NumRows: 3 NumCols: 4
|
// NumRows: 3 NumCols: 4
|
||||||
```
|
```
|
||||||
@ -848,7 +848,7 @@ These can be chained: you can apply another `Tensor` Operation to the value
|
|||||||
returned by the method.
|
returned by the method.
|
||||||
|
|
||||||
The chain of Operation is evaluated lazily, typically when it is assigned to a
|
The chain of Operation is evaluated lazily, typically when it is assigned to a
|
||||||
tensor. See [Controlling When Expression are Evaluated](#controlling-when-expression-are-evaluated) for more details about
|
tensor. See **Controlling When Expression are Evaluated** for more details about
|
||||||
their evaluation.
|
their evaluation.
|
||||||
|
|
||||||
### (Operation) constant(const Scalar& val)
|
### (Operation) constant(const Scalar& val)
|
||||||
@ -858,7 +858,7 @@ where all elements have the value `val`.
|
|||||||
|
|
||||||
This is useful, for example, when you want to add or subtract a constant from a
|
This is useful, for example, when you want to add or subtract a constant from a
|
||||||
tensor, or multiply every element of a tensor by a scalar.
|
tensor, or multiply every element of a tensor by a scalar.
|
||||||
However, such operations can also be performed using operator overloads (see [operator+](#operation-operator-scalar-s)).
|
However, such operations can also be performed using operator overloads (see `operator+`).
|
||||||
|
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
@ -927,7 +927,7 @@ std::cout << "b\n" << b << "\n\n";
|
|||||||
// a
|
// a
|
||||||
// 1 1 1
|
// 1 1 1
|
||||||
// 1 1 1
|
// 1 1 1
|
||||||
//
|
//
|
||||||
// b
|
// b
|
||||||
// -1 -1 -1
|
// -1 -1 -1
|
||||||
// -1 -1 -1
|
// -1 -1 -1
|
||||||
@ -1010,7 +1010,7 @@ std::cout << "b" << endl << b << endl << endl;
|
|||||||
// a
|
// a
|
||||||
// 0 1 8
|
// 0 1 8
|
||||||
// 27 64 125
|
// 27 64 125
|
||||||
//
|
//
|
||||||
// b
|
// b
|
||||||
// 0 1 2
|
// 0 1 2
|
||||||
// 3 4 5
|
// 3 4 5
|
||||||
@ -1031,7 +1031,7 @@ std::cout << "scaled_a\n" << scaled_a << "\n";
|
|||||||
// a
|
// a
|
||||||
// 1 2 3
|
// 1 2 3
|
||||||
// 4 5 6
|
// 4 5 6
|
||||||
//
|
//
|
||||||
// scaled_a
|
// scaled_a
|
||||||
// 2 4 6
|
// 2 4 6
|
||||||
// 8 10 12
|
// 8 10 12
|
||||||
@ -1048,8 +1048,8 @@ Divides every element in the tensor by `s`.
|
|||||||
### (Operation) operator% (Scalar s)
|
### (Operation) operator% (Scalar s)
|
||||||
Computes the element-wise modulus (remainder) of each tensor element divided by `s`
|
Computes the element-wise modulus (remainder) of each tensor element divided by `s`
|
||||||
|
|
||||||
**Only integer types are supported.**
|
**Only integer types are supported.**
|
||||||
For floating-point tensors, implement a [unaryExpr](#operation-unaryexprcustomunaryop-func) using `std::fmod`.
|
For floating-point tensors, implement a `unaryExpr` using `std::fmod`.
|
||||||
|
|
||||||
### (Operation) cwiseMax(Scalar threshold)
|
### (Operation) cwiseMax(Scalar threshold)
|
||||||
Returns the coefficient-wise maximum between two tensors.
|
Returns the coefficient-wise maximum between two tensors.
|
||||||
@ -1203,10 +1203,10 @@ The following boolean operators are supported:
|
|||||||
* `operator>=(const OtherDerived& other)`
|
* `operator>=(const OtherDerived& other)`
|
||||||
* `operator==(const OtherDerived& other)`
|
* `operator==(const OtherDerived& other)`
|
||||||
* `operator!=(const OtherDerived& other)`
|
* `operator!=(const OtherDerived& other)`
|
||||||
|
|
||||||
as well as bitwise operators:
|
as well as bitwise operators:
|
||||||
|
|
||||||
* `operator&(const OtherDerived& other)`
|
* `operator&(const OtherDerived& other)`
|
||||||
* `operator|(const OtherDerived& other)`
|
* `operator|(const OtherDerived& other)`
|
||||||
* `operator^(const OtherDerived& other)`
|
* `operator^(const OtherDerived& other)`
|
||||||
|
|
||||||
@ -1448,7 +1448,7 @@ std::cout << "Flat argmax index: " << argmax_flat();
|
|||||||
|
|
||||||
### (Operation) argmin(const Dimensions& reduction_dim)
|
### (Operation) argmin(const Dimensions& reduction_dim)
|
||||||
### (Operation) argmin()
|
### (Operation) argmin()
|
||||||
See [argmax](#operation-argmaxconst-dimensions-reduction_dim)
|
See `argmax`.
|
||||||
|
|
||||||
### (Operation) reduce(const Dimensions& reduction_dims, const Reducer& reducer)
|
### (Operation) reduce(const Dimensions& reduction_dims, const Reducer& reducer)
|
||||||
|
|
||||||
@ -1953,7 +1953,7 @@ std::cout << "b\n" << b << "\n";
|
|||||||
|
|
||||||
### (Operation) roll(const Rolls& shifts)
|
### (Operation) roll(const Rolls& shifts)
|
||||||
|
|
||||||
Returns a tensor with the elements **circularly shifted** (like bit rotation) along one or more dimensions.
|
Returns a tensor with the elements **circularly shifted** (like bit rotation) along one or more dimensions.
|
||||||
|
|
||||||
For each dimension `i`, the content is shifted by `shifts[i]` positions:
|
For each dimension `i`, the content is shifted by `shifts[i]` positions:
|
||||||
|
|
||||||
@ -2277,7 +2277,7 @@ std::cout << "b\n" << b << "\n";
|
|||||||
```
|
```
|
||||||
|
|
||||||
### (Operation) eval()
|
### (Operation) eval()
|
||||||
See [Calling eval()](#calling-eval)
|
See **Calling eval()**.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2340,7 +2340,7 @@ For example `Tensor<T, N>::maximum()` returns a `Tensor<T, 0>`.
|
|||||||
|
|
||||||
Similarly, the inner product of 2 1d tensors (through contractions) returns a 0d tensor.
|
Similarly, the inner product of 2 1d tensors (through contractions) returns a 0d tensor.
|
||||||
|
|
||||||
The scalar value can be extracted as explained in [Reduction along all dimensions](#reduction-along-all-dimensions).
|
The scalar value can be extracted as explained in **Reduction along all dimensions**.
|
||||||
|
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
@ -2349,4 +2349,4 @@ The scalar value can be extracted as explained in [Reduction along all dimension
|
|||||||
compiler that supports cxx11. It is limited to only 5 for older compilers.
|
compiler that supports cxx11. It is limited to only 5 for older compilers.
|
||||||
* The `IndexList` class requires a cxx11 compliant compiler. You can use an
|
* The `IndexList` class requires a cxx11 compliant compiler. You can use an
|
||||||
array of indices instead if you don't have access to a modern compiler.
|
array of indices instead if you don't have access to a modern compiler.
|
||||||
* On GPUs only floating point values are properly tested and optimized for.
|
* On GPUs only floating point values are properly tested and optimized for.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user