flip back fixed 44 as not working on linux

This commit is contained in:
sugarme 2021-07-06 19:11:32 +10:00
parent fc2a3332b1
commit ec77385d31
2 changed files with 6 additions and 4 deletions

View File

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [Nofix]
- ctype `long` caused compiling error in MacOS as noted on [#44]. Not working on linux box.
## [0.3.12]
- Fixed multiple memory leakage at `vision/image.go`
- Fixed memory leakage at `dutil/dataloader.go`
@ -24,7 +27,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Changed `vision/aug` and correct Resize
- Changed `dutil/sampler` to accept batchsize from 1.
- Fixed double free in `vision/image.go/resizePreserveAspectRatio`
- Fixed incorrect ctype `long` caused compiling error in MacOS as noted on [#44]
## [0.3.11]

View File

@ -96,7 +96,7 @@ func AtDim(t Ctensor) uint64 {
// void at_shape(tensor, int64_t *);
func AtShape(t Ctensor, ptr unsafe.Pointer) {
c_ptr := (*C.longlong)(ptr)
c_ptr := (*C.long)(ptr)
C.at_shape(t, c_ptr)
}
@ -137,7 +137,7 @@ func AtcSetBenchmarkCudnn(b int) {
// double at_double_value_at_indexes(tensor, int64_t *indexes, int indexes_len);
func AtDoubleValueAtIndexes(ts Ctensor, indexes unsafe.Pointer, indexesLen int) float64 {
ctensor := (C.tensor)(ts)
cindexes := (*C.longlong)(indexes)
cindexes := (*C.long)(indexes)
cindexesLen := *(*C.int)(unsafe.Pointer(&indexesLen))
retVal := C.at_double_value_at_indexes(ctensor, cindexes, cindexesLen)
return *(*float64)(unsafe.Pointer(&retVal))
@ -146,7 +146,7 @@ func AtDoubleValueAtIndexes(ts Ctensor, indexes unsafe.Pointer, indexesLen int)
// int64_t at_int64_value_at_indexes(tensor, int64_t *indexes, int indexes_len);
func AtInt64ValueAtIndexes(ts Ctensor, indexes unsafe.Pointer, indexesLen int) int64 {
ctensor := (C.tensor)(ts)
cindexes := (*C.longlong)(indexes)
cindexes := (*C.long)(indexes)
cindexesLen := *(*C.int)(unsafe.Pointer(&indexesLen))
retVal := C.at_int64_value_at_indexes(ctensor, cindexes, cindexesLen)
return *(*int64)(unsafe.Pointer(&retVal))