MCPcopy
hub / github.com/nlpodyssey/spago / UnmarshalBinary

Method UnmarshalBinary

mat/dense_marshaling.go:34–43  ·  view source on GitHub ↗

UnmarshalBinary unmarshals a binary representation of a Dense matrix.

(data []byte)

Source from the content-addressed store, hash-verified

32
33// UnmarshalBinary unmarshals a binary representation of a Dense matrix.
34func (d *Dense[T]) UnmarshalBinary(data []byte) error {
35 switch any(T(0)).(type) {
36 case float32:
37 return d.unmarshalBinaryFloat32(data)
38 case float64:
39 return d.unmarshalBinaryFloat64(data)
40 default:
41 panic(fmt.Sprintf("mat: unexpected dense matrix type %T", T(0)))
42 }
43}
44
45func (d *Dense[T]) marshalBinaryFloat32() ([]byte, error) {
46 b := flatbuffers.NewBuilder(0)

Callers 2

testDenseMarshalingFunction · 0.45

Calls 3

TInterface · 0.70

Tested by 2

testDenseMarshalingFunction · 0.36