ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnfw::cker::BatchMatMulParams Struct Reference

#include <BatchMatMulParams.h>

Public Member Functions

 BatchMatMulParams (const Shape &lhs_shape, const Shape &rhs_shape)
 

Data Fields

int batch_dim0
 
int batch_dim1
 
int batch_dim2
 
int lhs_ext0
 
int lhs_ext1
 
int lhs_ext2
 
int rhs_ext0
 
int rhs_ext1
 
int rhs_ext2
 
int lhs_rows
 
int lhs_cols
 
int rhs_rows
 
int rhs_cols
 
int accum_depth
 

Detailed Description

Definition at line 26 of file BatchMatMulParams.h.

Constructor & Destructor Documentation

◆ BatchMatMulParams()

nnfw::cker::BatchMatMulParams::BatchMatMulParams ( const Shape lhs_shape,
const Shape rhs_shape 
)
inline

Definition at line 28 of file BatchMatMulParams.h.

29 {
30 const Shape extended_lhs_shape = Shape::ExtendedShape(5, lhs_shape);
31 const Shape extended_rhs_shape = Shape::ExtendedShape(5, rhs_shape);
32
33 batch_dim0 = broadcast_dim(extended_lhs_shape.Dims(0), extended_rhs_shape.Dims(0));
34 batch_dim1 = broadcast_dim(extended_lhs_shape.Dims(1), extended_rhs_shape.Dims(1));
35 batch_dim2 = broadcast_dim(extended_lhs_shape.Dims(2), extended_rhs_shape.Dims(2));
36
37 lhs_ext0 = extent(extended_lhs_shape, 0);
38 lhs_ext1 = extent(extended_lhs_shape, 1);
39 lhs_ext2 = extent(extended_lhs_shape, 2);
40 rhs_ext0 = extent(extended_rhs_shape, 0);
41 rhs_ext1 = extent(extended_rhs_shape, 1);
42 rhs_ext2 = extent(extended_rhs_shape, 2);
43
44 // Set params for each matrix multiply.
45 lhs_rows = extended_lhs_shape.Dims(3);
46 lhs_cols = extended_lhs_shape.Dims(4);
47 rhs_rows = extended_rhs_shape.Dims(3);
48 rhs_cols = extended_rhs_shape.Dims(4);
49 accum_depth = extended_lhs_shape.Dims(4);
50 }
Definition Shape.h:28

References accum_depth, batch_dim0, batch_dim1, batch_dim2, nnfw::cker::Shape::Dims(), lhs_cols, lhs_ext0, lhs_ext1, lhs_ext2, lhs_rows, rhs_cols, rhs_ext0, rhs_ext1, rhs_ext2, and rhs_rows.

Field Documentation

◆ accum_depth

int nnfw::cker::BatchMatMulParams::accum_depth

Definition at line 65 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ batch_dim0

int nnfw::cker::BatchMatMulParams::batch_dim0

Definition at line 52 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ batch_dim1

int nnfw::cker::BatchMatMulParams::batch_dim1

Definition at line 53 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ batch_dim2

int nnfw::cker::BatchMatMulParams::batch_dim2

Definition at line 54 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ lhs_cols

int nnfw::cker::BatchMatMulParams::lhs_cols

Definition at line 62 of file BatchMatMulParams.h.

Referenced by BatchMatMulParams().

◆ lhs_ext0

int nnfw::cker::BatchMatMulParams::lhs_ext0

Definition at line 55 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ lhs_ext1

int nnfw::cker::BatchMatMulParams::lhs_ext1

Definition at line 56 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ lhs_ext2

int nnfw::cker::BatchMatMulParams::lhs_ext2

Definition at line 57 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ lhs_rows

int nnfw::cker::BatchMatMulParams::lhs_rows

Definition at line 61 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ rhs_cols

int nnfw::cker::BatchMatMulParams::rhs_cols

Definition at line 64 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ rhs_ext0

int nnfw::cker::BatchMatMulParams::rhs_ext0

Definition at line 58 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ rhs_ext1

int nnfw::cker::BatchMatMulParams::rhs_ext1

Definition at line 59 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ rhs_ext2

int nnfw::cker::BatchMatMulParams::rhs_ext2

Definition at line 60 of file BatchMatMulParams.h.

Referenced by nnfw::cker::reference::BatchMatMul(), and BatchMatMulParams().

◆ rhs_rows

int nnfw::cker::BatchMatMulParams::rhs_rows

Definition at line 63 of file BatchMatMulParams.h.

Referenced by BatchMatMulParams().


The documentation for this struct was generated from the following file: