seominjoon / denspi

Real-Time Open-Domain Question Answering with Dense-Sparse Phrase Index (DenSPI)
https://nlp.cs.washington.edu/denspi
Apache License 2.0
200 stars 26 forks source link

how to convert each float32 value to int8? #4

Closed Jasperty closed 5 years ago

Jasperty commented 5 years ago

how to convert each float32 value to int8? where is the code about this?

jhyuklee commented 5 years ago

Hi @Jasperty,

float to int conversion code is here: https://github.com/uwnlp/denspi/blob/7762bfbc914346bb5ad933d44c6f8b95454cf62d/post.py#L574-L578

FYI, dequantization (int to float) is here: https://github.com/uwnlp/denspi/blob/7762bfbc914346bb5ad933d44c6f8b95454cf62d/open/mips.py#L15-L16

Thank you.