module onnxrt.ops_cpu.op_gemm
#
Short summary#
module mlprodict.onnxrt.ops_cpu.op_gemm
Runtime operator.
Classes#
class |
truncated documentation |
---|---|
Gemm ==== General Matrix multiplication: https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3 A’ = transpose(A) … |
Properties#
property |
truncated documentation |
---|---|
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of modified parameters. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns all parameters in a dictionary. |
Static Methods#
staticmethod |
truncated documentation |
---|---|
Methods#
method |
truncated documentation |
---|---|
Documentation#
Runtime operator.
- class mlprodict.onnxrt.ops_cpu.op_gemm.Gemm(onnx_node, desc=None, **options)#
Bases:
OpRun
General Matrix multiplication: https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3
A’ = transpose(A) if transA else A
B’ = transpose(B) if transB else B
Compute Y = alpha * A’ * B’ + beta * C, where input tensor A has shape (M, K) or (K, M), input tensor B has shape (K, N) or (N, K), input tensor C is broadcastable to shape (M, N), and output tensor Y has shape (M, N). A will be transposed before doing the computation if attribute transA is non-zero, same for B and transB. This operator supports unidirectional broadcasting (tensor C should be unidirectional broadcastable to tensor A * B); for more details please check Broadcasting in ONNX. This operator has optional inputs/outputs. See ONNX for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.
Attributes
alpha: Scalar multiplier for the product of input tensors A * B. Default value is
namealphaf1.0typeFLOAT
(FLOAT)beta: Scalar multiplier for input tensor C. Default value is
namebetaf1.0typeFLOAT
(FLOAT)transA: Whether A should be transposed Default value is
nametransAi0typeINT
(INT)transB: Whether B should be transposed Default value is
nametransBi0typeINT
(INT)
Inputs
Between 2 and 3 inputs.
A (heterogeneous)T: Input tensor A. The shape of A should be (M, K) if transA is 0, or (K, M) if transA is non-zero.
B (heterogeneous)T: Input tensor B. The shape of B should be (K, N) if transB is 0, or (N, K) if transB is non-zero.
C (optional, heterogeneous)T: Optional input tensor C. If not specified, the computation is done as if C is a scalar 0. The shape of C should be unidirectional broadcastable to (M, N).
Outputs
Y (heterogeneous)T: Output tensor of shape (M, N).
Type Constraints
T tensor(float16), tensor(float), tensor(double), tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(bfloat16): Constrain input and output types to float/int tensors.
Version
Onnx name: Gemm
This version of the operator has been available since version 13.
Runtime implementation:
Gemm
- __init__(onnx_node, desc=None, **options)#
- static _gemm00(a, b, c, alpha, beta)#
- static _gemm01(a, b, c, alpha, beta)#
- static _gemm10(a, b, c, alpha, beta)#
- static _gemm11(a, b, c, alpha, beta)#
- _run(a, b, c=None, attributes=None, verbose=0, fLOG=None)#
Should be overwritten.