INNER CODE UNIT · Go

validateMatrixDimensions

takara-ai/go-attention · attention/attention.go:260

func validateMatrixDimensions(matrices ...Matrix) error {
	if len(matrices) == 0 {
		return nil
	}
	
	firstDim := len(matrices[0])
	for i, m := range matrices {
		if len(m) != firstDim {
			return fmt.Errorf("matrix %d has %d rows, expected %d", i, len(m), firstDim)
		}
	}
	return nil
} 

// TODO: kv caching
// TODO: tokenization support
// TODO: rotary positional embedding support RoPE
// TODO: SwarmFormer Local-Global Hiearchical Attention Support

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…