1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2023-09-28 16:42:08 +03:00
202 changed files with 14784 additions and 7242 deletions
@@ -241,6 +241,39 @@ CV__DNN_INLINE_NS_BEGIN
};
/** @brief This function performs array summation based
* on the Einstein summation convention. The function
* allows for concise expressions of various mathematical
* operations using subscripts.
*
* By default, the labels are placed in alphabetical
* order at the end of the output.
* For example:
* if `c = einsum("i,j", a, b)`, then `c[i,j] == a[i]*b[j]`.
* However, if `c = einsum("j,i", a, b)`, then `c[i,j] = a[j]*b[i]`.
* Alternatively, you can control the output order or prevent
* an axis from being summed/force an axis to be summed
* by providing indices for the output.
* For example:
* `diag(a)` -> `einsum("ii->i", a)`
* `sum(a, axis=0)` -> `einsum("i...->", a)`
* Subscripts at the beginning and end may be specified
* by putting an ellipsis "..." in the middle.
* For instance, the function `einsum("i...i", a)` takes
* the diagonal of the first and last dimensions of
* the operand, and `einsum("ij...,jk...->ik...")` performs
* the matrix product using the first two indices
* of each operand instead of the last two.
* When there is only one operand, no axes being summed,
* and no output parameter, this function returns
* a view into the operand instead of creating a copy.
*/
class CV_EXPORTS EinsumLayer : public Layer
{
public:
static Ptr<EinsumLayer> create(const LayerParams& params);
};
class CV_EXPORTS BaseConvolutionLayer : public Layer
{
public:
@@ -1101,6 +1134,22 @@ CV__DNN_INLINE_NS_BEGIN
static Ptr<LayerNormLayer> create(const LayerParams& params);
};
class CV_EXPORTS GemmLayer : public Layer {
public:
bool trans_a;
bool trans_b;
float alpha;
float beta;
static Ptr<GemmLayer> create(const LayerParams& params);
};
class CV_EXPORTS ExpandLayer : public Layer
{
public:
static Ptr<ExpandLayer> create(const LayerParams &params);
};
//! @}
//! @}
CV__DNN_INLINE_NS_END