dotnet / TorchSharp

A .NET library that provides access to the library that powers PyTorch.
MIT License
1.4k stars 182 forks source link

float16/half/bfloat16 #160

Closed dsyme closed 4 years ago

dsyme commented 4 years ago

158 added interim float16 support.

However PyTorch only implements float16 on the GPU.

Arithmetic (add, sub, mul, div) is not implemented for float16 on CPU. (Not just in-place ops). Pretty much only conversions are implemented. These ops are implemented for GPU. You can use torch.bfloat16 on CPU.

Note bfloat16 is supported on CPU.

We should update TorchSHarp to include both float16 and bfloat16 support

dsyme commented 4 years ago

Completed to first iteration in #183