wangkuiyi / gotorch

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

use ReadFull instead of Read #349

Closed QiJune closed 4 years ago

QiJune commented 4 years ago

Fix #346

Read reads data into p. It returns the number of bytes read into p. 
The bytes are taken from at most one Read on the underlying Reader, hence n may be less than len(p).
To read exactly len(p) bytes, use io.ReadFull(b, p). At EOF, the count will be zero and err will be io.EOF.
codecov[bot] commented 4 years ago

Codecov Report

Merging #349 into develop will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #349   +/-   ##
========================================
  Coverage    87.29%   87.29%           
========================================
  Files           33       33           
  Lines         1448     1448           
========================================
  Hits          1264     1264           
  Misses         121      121           
  Partials        63       63           
Impacted Files Coverage Δ
vision/imageloader/imageloader.go 85.71% <100.00%> (ø)