For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
pad_reflect
def pad_reflect[dtype: DType, paddings_type: DType](output: TileTensor[dtype, Storage=output.Storage, linear_idx_type=output.linear_idx_type], input: TileTensor[dtype, Storage=input.Storage, linear_idx_type=input.linear_idx_type], paddings: Pointer[Scalar[paddings_type], _safe=False])
Fill output with values from input, and edges padded with reflected values from the unpadded region.
Example: var input = [[1, 2], [3, 4]] var paddings = [2, 2, 1, 0]
Yields: output = [[2, 1, 2], [4, 3, 4], [2, 1, 2], [4, 3, 4], [2, 1, 2], [4, 3, 4]]
Parameters:
- βdtype (
DType): DType of theinputandoutputbuffers. - βpaddings_type (
DType): DType of thepaddingsbuffer.
Args:
- βoutput (
TileTensor[dtype, Storage=output.Storage, linear_idx_type=output.linear_idx_type]): The output buffer. - βinput (
TileTensor[dtype, Storage=input.Storage, linear_idx_type=input.linear_idx_type]): The input buffer. - βpaddings (
Pointer[Scalar[paddings_type], _safe=False]): Ordered (before, after) padding sizes for each axis.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!