|
Tensor | full_to_reduced (const Tensor &full, const torch::Tensor &rmap, const torch::Tensor &rfactors, Size dim=0) |
| Generic function to reduce two axes to one with some map.
|
|
Tensor | reduced_to_full (const Tensor &reduced, const torch::Tensor &rmap, const torch::Tensor &rfactors, Size dim=0) |
| Convert a Tensor from reduced notation to full notation.
|
|
Tensor | full_to_mandel (const Tensor &full, Size dim=0) |
| Convert a Tensor from full notation to Mandel notation.
|
|
Tensor | mandel_to_full (const Tensor &mandel, Size dim=0) |
| Convert a Tensor from Mandel notation to full notation.
|
|
Tensor | full_to_skew (const Tensor &full, Size dim=0) |
| Convert a Tensor from full notation to skew vector notation.
|
|
Tensor | skew_to_full (const Tensor &skew, Size dim=0) |
| Convert a Tensor from skew vector notation to full notation.
|
|
Tensor | jacrev (const Tensor &y, const Tensor &x, bool retain_graph=false, bool create_graph=false, bool allow_unused=false) |
| Use automatic differentiation (AD) to calculate the derivatives of a Tensor w.r.t. another Tensor.
|
|
Tensor | base_diag_embed (const Tensor &a, Size offset, Size d1, Size 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.
|
|
Tensor | base_cat (const std::vector< Tensor > &tensors, Size d) |
|
Tensor | base_stack (const std::vector< Tensor > &tensors, Size d) |
|
Tensor | base_sum (const Tensor &a, Size d) |
|
Tensor | base_mean (const Tensor &a, Size d) |
|
Tensor | pow (const Real &a, const Tensor &n) |
|
Tensor | pow (const Tensor &a, const Tensor &n) |
|
Scalar | minimum (const Scalar &a, const Scalar &b) |
| Minimum between two scalars.
|
|
Tensor | bmm (const Tensor &a, const Tensor &b) |
| Batched matrix-matrix product.
|
|
Tensor | bmv (const Tensor &a, const Tensor &v) |
| Batched matrix-vector product.
|
|
Tensor | bvv (const Tensor &a, const Tensor &b) |
| Batched vector-vector (dot) product.
|
|
constexpr Real | mandel_factor (Size i) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | batch_cat (const std::vector< T > &tensors, Size d=0) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | batch_stack (const std::vector< T > &tensors, Size d=0) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | batch_sum (const T &a, Size d=0) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | batch_mean (const T &a, Size d=0) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | pow (const T &a, const Real &n) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | sign (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | cosh (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | sinh (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | tanh (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | arccos (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | arcsin (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | where (const torch::Tensor &condition, const T &a, const T &b) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | heaviside (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | macaulay (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | dmacaulay (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | sqrt (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | exp (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | abs (const T &a) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | diff (const T &a, Size n=1, Size dim=-1) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | batch_diag_embed (const T &a, Size offset=0, Size d1=-2, Size d2=-1) |
|
template<class T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
T | log (const T &a) |
|
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>> |
Derived | pow (const Derived &a, const Scalar &n) |
|
Convert a Tensor
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
- Tensor 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
- Tensor The reduced tensor
Convert a Tensor
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
- Tensor The resulting tensor using skew notation to represent the skew-symmetric axes.