Table of Contents

Class SpMVOp

Namespace
AiDotNet.JitCompiler.IR.Operations
Assembly
AiDotNet.dll

Represents sparse matrix-vector multiplication in the IR.

public class SpMVOp : IROp
Inheritance
SpMVOp
Inherited Members

Remarks

SpMV computes y = A * x where A is a sparse matrix and x is a dense vector. This is a fundamental operation for graph neural networks and sparse models.

For Beginners: Sparse matrices have mostly zero values. Instead of storing all those zeros, we only store the non-zero elements. SpMV multiplies such a sparse matrix by a regular (dense) vector efficiently.

Properties

Columns

Gets or sets the number of columns in the sparse matrix.

public int Columns { get; set; }

Property Value

int

NonZeroCount

Gets or sets the number of non-zero elements.

public int NonZeroCount { get; set; }

Property Value

int

Rows

Gets or sets the number of rows in the sparse matrix.

public int Rows { get; set; }

Property Value

int

Methods

Validate()

Validates that this operation is correctly formed.

public override bool Validate()

Returns

bool

True if valid, false otherwise.