Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [GoSDK] fp32 <-> fp16/bf16 vector conversion #37978

Merged

Commits on Nov 28, 2024

  1. feat: [GoSDK] fp32 <-> fp16/bf16 vector conversion

    Add the following methods for convenient fp32 vector <-> fp16/bf16
    vector conversion
    
    fp32 <-> fp16/bf16 vector conversion:
    
    - `func (fv FloatVector) ToFloat16Vector() Float16Vector`
    - `func (fv FloatVector) ToBFloat16Vector() BFloat16Vector`
    - `func (fv Float16Vector) ToFloat32Vector() FloatVector`
    - `func (fv BFloat16Vector) ToFloat32Vector() FloatVector`
    
    `columnBasedDataOption`:
    
    - `func (opt *columnBasedDataOption) WithFloat16VectorColumn(colName string, dim int, data [][]float32) *columnBasedDataOption`
    - `func (opt *columnBasedDataOption) WithBFloat16VectorColumn(colName string, dim int, data [][]float32) *columnBasedDataOption`
    
    `ColumnFloat16Vector`/`ColumnBFloat16Vector`:
    
    - `func NewColumnFloat16VectorFromFp32Vector(fieldName string, dim int, data [][]float32) *ColumnFloat16Vector`
    - `func NewColumnBFloat16VectorFromFp32Vector(fieldName string, dim int, data [][]float32) *ColumnBFloat16Vector`
    - support []float32 or `entity.FloatVector` in
        - `func (c *ColumnFloat16Vector) AppendValue(i interface{}) error`
        - `func (c *ColumnFloat16Vector) AppendValue(i interface{}) error`
    
    issue: milvus-io#37448
    
    Signed-off-by: Yinzuo Jiang <[email protected]>
    Signed-off-by: Yinzuo Jiang <[email protected]>
    jiangyinzuo committed Nov 28, 2024
    Configuration menu
    Copy the full SHA
    e90721b View commit details
    Browse the repository at this point in the history