|
BatchTensor | full_to_reduced (const BatchTensor &full, const torch::Tensor &rmap, const torch::Tensor &rfactors, TorchSize dim=0) |
| Generic function to reduce two axes to one with some map.
|
|
BatchTensor | reduced_to_full (const BatchTensor &reduced, const torch::Tensor &rmap, const torch::Tensor &rfactors, TorchSize dim=0) |
| Convert a BatchTensor from reduced notation to full notation.
|
|
BatchTensor | full_to_mandel (const BatchTensor &full, TorchSize dim=0) |
| Convert a BatchTensor from full notation to Mandel notation.
|
|
BatchTensor | mandel_to_full (const BatchTensor &mandel, TorchSize dim=0) |
| Convert a BatchTensor from Mandel notation to full notation.
|
|
BatchTensor | full_to_skew (const BatchTensor &full, TorchSize dim=0) |
| Convert a BatchTensor from full notation to skew vector notation.
|
|
BatchTensor | skew_to_full (const BatchTensor &skew, TorchSize dim=0) |
| Convert a BatchTensor from skew vector notation to full notation.
|
|
BatchTensor | jacrev (const BatchTensor &y, const BatchTensor &p) |
| Use automatic differentiation (AD) to calculate the derivatives w.r.t. to the parameter.
|
|
BatchTensor | base_diag_embed (const BatchTensor &a, TorchSize offset, TorchSize d1, TorchSize d2) |
|
SR2 | skew_and_sym_to_sym (const SR2 &e, const WR2 &w) |
| Product w_ik e_kj - e_ik w_kj with e SR2 and w WR2.
|
|
SSR4 | d_skew_and_sym_to_sym_d_sym (const WR2 &w) |
| Derivative of w_ik e_kj - e_ik w_kj wrt. e.
|
|
SWR4 | d_skew_and_sym_to_sym_d_skew (const SR2 &e) |
| Derivative of w_ik e_kj - e_ik w_kj wrt. w.
|
|
WR2 | multiply_and_make_skew (const SR2 &a, const SR2 &b) |
| Shortcut product a_ik b_kj - b_ik a_kj with both SR2.
|
|
WSR4 | d_multiply_and_make_skew_d_first (const SR2 &b) |
| Derivative of a_ik b_kj - b_ik a_kj wrt a.
|
|
WSR4 | d_multiply_and_make_skew_d_second (const SR2 &a) |
| Derivative of a_ik b_kj - b_ik a_kj wrt b.
|
|
BatchTensor | bmm (const BatchTensor &a, const BatchTensor &b) |
| Batched matrix-matrix product.
|
|
BatchTensor | bmv (const BatchTensor &a, const BatchTensor &v) |
| Batched matrix-vector product.
|
|
BatchTensor | bvv (const BatchTensor &a, const BatchTensor &b) |
| Batched vector-vector (dot) product.
|
|
constexpr Real | mandel_factor (TorchSize i) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | pow (const Derived &a, const Real &n) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | pow (const Real &a, const Derived &n) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | pow (const Derived &a, const Derived &n) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | sign (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | cosh (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | sinh (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | tanh (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | where (const torch::Tensor &condition, const Derived &a, const Derived &b) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | heaviside (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | macaulay (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | dmacaulay (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | sqrt (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | exp (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | abs (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | diff (const Derived &a, TorchSize n=1, TorchSize dim=-1) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | batch_diag_embed (const Derived &a, TorchSize offset=0, TorchSize d1=-2, TorchSize d2=-1) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | log (const Derived &a) |
|
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | pow (const Derived &a, const Scalar &n) |
|
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>, Derived>>> |
Derived | pow (const Scalar &a, const Derived &n) |
|
|
constexpr Real | eps = std::numeric_limits<at::scalar_value_type<Real>::type>::epsilon() |
|
constexpr Real | sqrt2 = 1.4142135623730951 |
|
constexpr Real | invsqrt2 = 0.7071067811865475 |
|
constexpr TorchSize | mandel_reverse_index [3][3] = {{0, 5, 4}, {5, 1, 3}, {4, 3, 2}} |
|
constexpr TorchSize | mandel_index [6][2] = {{0, 0}, {1, 1}, {2, 2}, {1, 2}, {0, 2}, {0, 1}} |
|
constexpr TorchSize | skew_reverse_index [3][3] = {{0, 2, 1}, {2, 0, 0}, {1, 0, 0}} |
|
constexpr Real | skew_factor [3][3] = {{0.0, -1.0, 1.0}, {1.0, 0.0, -1.0}, {-1.0, 1.0, 0.0}} |
|
Convert a BatchTensor
from full notation to Mandel notation.
The tensor in full notation full
can have arbitrary batch shape. The optional argument dim
denotes the base dimension starting from which the conversion should take place.
For example, a full tensor has shape (2, 3, 1, 5; 2, 9, 3, 3, 2, 3)
where the semicolon separates batch and base shapes. The symmetric axes have base dim 2 and 3. After converting to Mandel notation, the resulting tensor will have shape (2, 3, 1, 5; 2, 9, 6, 2, 3)
. Note how the shape of the symmetric dimensions (3, 3)
becomes (6)
. In this example, the base dim (the second argument to this function) should be 2.
- Parameters
-
full | The input tensor in full notation |
dim | The base dimension where the symmetric axes start |
- Returns
- BatchTensor The resulting tensor using Mandel notation to represent the symmetric axes.
Generic function to reduce two axes to one with some map.
The tensor in full notation full
can have arbitrary batch shape. The optional argument dim
denotes the base dimension starting from which the conversion should take place.
The function will reduce the two axis at the desired location down to one, using the provided maps.
For example, a full tensor has shape (2, 3, 1, 5; 2, 9, 3, 3, 2, 3)
where the semicolon separates batch and base shapes. The reduction axes have base dim 2 and 3. After applying the reduction, the resulting tensor will have shape (2, 3, 1, 5; 2, 9, X, 2, 3)
where X is the reduced shape. In this example, the base dim (the second argument to this function) should be 2.
- Parameters
-
full | The input tensor in full notation |
rmap | The reduction map |
rfactors | The reduction factors |
dim | The base dimension where the reduced axes start |
- Returns
- BatchTensor The reduced tensor
Convert a BatchTensor
from full notation to skew vector notation.
The tensor in full notation full
can have arbitrary batch shape. The optional argument dim
denotes the base dimension starting from which the conversion should take place.
For example, a full tensor has shape (2, 3, 1, 5; 2, 9, 3, 3, 2, 3)
where the semicolon separates batch and base shapes. The symmetric axes have base dim 2 and 3. After converting to skew notation, the resulting tensor will have shape (2, 3, 1, 5; 2, 9, 3, 2, 3)
. Note how the shape of the symmetric dimensions (3, 3)
becomes (3)
. In this example, the base dim (the second argument to this function) should be 2.
- Parameters
-
full | The input tensor in full notation |
dim | The base dimension where the symmetric axes start |
- Returns
- BatchTensor The resulting tensor using skew notation to represent the skew-symmetric axes.