DriftTexture · function

patchEmbed

A patch embedding: a convolution with stride and kernel both patch, written token-major — out[tokens][dim], tokens row by row — which is the order a transformer reads them in.

Explained in DriftTexture.

function patchEmbed(out: Float32Array, image: Float32Array, cin: number, h: number, w: number, weight: Float32Array, bias: Float32Array | null, dim: number, patch: number): void
import { patchEmbed } from '@driftengine/texture';

Parameters

ParameterTypeDescription
outFloat32Array
imageFloat32Array
cinnumber
hnumber
wnumber
weightFloat32Array
biasFloat32Array | null
dimnumber
patchnumber