diff --git a/CHANGELOG.md b/CHANGELOG.md index 539f624..12f10bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - added nn.BatchNorm.Forward() with default training=true - added exposing `tensor.Ctensor()` - added API `tensor.FromCtensor()` +- [#67]: fixed incorrect type casting at `atc_cuda_count` ## [Nofix] - ctype `long` caused compiling error in MacOS as noted on [#44]. Not working on linux box. diff --git a/libtch/tensor.go b/libtch/tensor.go index 9ec1dfd..b2f9d92 100644 --- a/libtch/tensor.go +++ b/libtch/tensor.go @@ -111,9 +111,9 @@ func GetAndResetLastErr() *C.char { } // int atc_cuda_device_count(); -func AtcCudaDeviceCount() int { +func AtcCudaDeviceCount() int32 { result := C.atc_cuda_device_count() - return *(*int)(unsafe.Pointer(&result)) + return *(*int32)(unsafe.Pointer(&result)) } // int atc_cuda_is_available();