wangkuiyi / gotorch

A Go idiomatic binding to the C++ core of PyTorch
MIT License
305 stars 35 forks source link

fix initialize lr set to 0 in ResNet training #357

Closed Yancey1989 closed 3 years ago

Yancey1989 commented 3 years ago

An int variable multiple a float value would be an INT, an int value multiple a float value would be FLOAT in Go. https://play.golang.org/p/f39Vw-9p23E image

codecov[bot] commented 3 years ago

Codecov Report

Merging #357 into develop will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #357   +/-   ##
========================================
  Coverage    87.46%   87.46%           
========================================
  Files           33       33           
  Lines         1468     1468           
========================================
  Hits          1284     1284           
  Misses         121      121           
  Partials        63       63           
shendiaomo commented 3 years ago

An int variable multiple a float value would be an INT, an int value multiple a float value would be FLOAT in Go. https://play.golang.org/p/f39Vw-9p23E image

The reason is that Go literals are untyped, see https://stackoverflow.com/questions/47213283/why-is-there-a-difference-between-floating-point-multiplication-with-literals-vs