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

how to set FP16 data #6

Open
tonglin96 opened this issue Feb 17, 2025 · 1 comment
Open

how to set FP16 data #6

tonglin96 opened this issue Feb 17, 2025 · 1 comment
Assignees

Comments

@tonglin96
Copy link

i want to use for this
input := http.NewInferInput("input_0", "FP16", []int64{1, 4, 3, 384, 128}, nil)

@berkayersoyy
Copy link
Member

berkayersoyy commented Feb 22, 2025

FP16 input data support is now available with v0.1.0, here's how you can use it;

input := http.NewInferInput("input_0", "FP16", []int64{1, 4, 3, 384, 128}, nil)
err := input.SetData([]float32{1,2,3}, true)
if err != nil {
	//error handling
}

Since Go does not natively support float16, we use float32 when working with the FP16 data type.

@berkayersoyy berkayersoyy self-assigned this Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants