Class PadOp
- Namespace
- AiDotNet.JitCompiler.IR.Operations
- Assembly
- AiDotNet.dll
Represents padding operation in the IR.
public class PadOp : IROp
- Inheritance
-
PadOp
- Inherited Members
Properties
InputShape
Input shape for kernel generation.
public int[] InputShape { get; set; }
Property Value
- int[]
PadWidth
Padding width per dimension as 2D array [dim, (before, after)].
public int[,]? PadWidth { get; set; }
Property Value
- int[,]
Padding
Simplified padding as 1D array [pad_before_0, pad_after_0, pad_before_1, pad_after_1, ...].
public int[] Padding { 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.
Remarks
Basic validation checks that the operation has required information. Derived classes can override to add operation-specific validation.
For Beginners: This checks that the operation makes sense.
Basic checks:
- Output ID is valid (non-negative)
- Has the right number of inputs
- Shapes are compatible
Specific operations add their own checks:
- MatMul: inner dimensions must match
- Conv2D: kernel size must be valid
- Reshape: total elements must be preserved
If validation fails, the operation can't be compiled.