s/From*Slice/From*s/ (#12255)

This commit is contained in:
Michael Yang
2025-10-28 12:08:49 -07:00
committed by GitHub
parent 15c7d30d9a
commit 1188f408dd
24 changed files with 95 additions and 76 deletions

View File

@@ -29,9 +29,9 @@ type TextModel struct {
}
func (m *TextModel) Forward(ctx ml.Context, batch input.Batch, cache kvcache.Cache) (ml.Tensor, error) {
positions := ctx.Input().FromIntSlice(batch.Positions, len(batch.Positions))
positions := ctx.Input().FromInts(batch.Positions, len(batch.Positions))
// Create a tensor of a single float32 value of 1.0 to use for altup correction
one := ctx.Input().FromFloatSlice([]float32{1.0}, 1)
one := ctx.Input().FromFloats([]float32{1.0}, 1)
inputs := m.TokenEmbedding.Forward(ctx, batch.Inputs, math.Sqrt(float64(m.hiddenSize)))
inputsPerLayer := m.PerLayerProjector.Forward(ctx, batch, inputs, &m.TextOptions)