Skip to content

Commit 22dc3a5

Browse files
fixmie[bot]abduld
fixmie[bot]
and
abduld
authored
Apply suggestions from code review
Co-Authored-By: abduld <[email protected]>
1 parent 785d5e1 commit 22dc3a5

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

reader/mxnet_recordio.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func NewRecordIOReader(path string) (*RecordIOReader, error) {
3232
}, nil
3333
}
3434

35+
// Next ...
3536
func (r *RecordIOReader) Next(ctx context.Context) (*ImageRecord, error) {
3637
f := r.r
3738

reader/record.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package reader
22

33
import "github.com/rai-project/image/types"
44

5+
// ImageRecord ...
56
type ImageRecord struct {
67
ID uint64
78
LabelIndex float32

reader/tfrecord.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type TFRecordReader struct {
2020
*terf.Reader
2121
}
2222

23+
// NewTFRecordReader ...
2324
func NewTFRecordReader(path string) (*TFRecordReader, error) {
2425
r, err := os.Open(path)
2526
if err != nil {

reader/tfrecord/features.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ func FeatureBool(rec *protobuf.Example, key string) bool {
99
return FeatureInt(rec, key) == 1
1010
}
1111

12+
// FeatureInt64 ...
1213
func FeatureInt64(rec *protobuf.Example, key string) int64 {
1314
f, ok := rec.Features.Feature[key]
1415
if !ok {
@@ -35,6 +36,7 @@ func FeatureFloat64(rec *protobuf.Example, key string) float64 {
3536
return float64(FeatureFloat32(rec, key))
3637
}
3738

39+
// FeatureFloat32 ...
3840
func FeatureFloat32(rec *protobuf.Example, key string) float32 {
3941
f, ok := rec.Features.Feature[key]
4042
if !ok {
@@ -71,6 +73,7 @@ func FeatureBytesSlice(rec *protobuf.Example, key string) [][]byte {
7173
return val.BytesList.Value
7274
}
7375

76+
// FeatureStringSlice ...
7477
func FeatureStringSlice(rec *protobuf.Example, key string) []string {
7578
slice := FeatureBytesSlice(rec, key)
7679
if slice == nil {
@@ -100,6 +103,7 @@ func FeatureInt64Slice(rec *protobuf.Example, key string) []int64 {
100103
return val.Int64List.Value
101104
}
102105

106+
// FeatureIntSlice ...
103107
func FeatureIntSlice(rec *protobuf.Example, key string) []int {
104108
slice := FeatureInt64Slice(rec, key)
105109
if slice == nil {
@@ -142,6 +146,7 @@ func FeatureFloat64Slice(rec *protobuf.Example, key string) []float64 {
142146
return res
143147
}
144148

149+
// FeatureFloat32Slice ...
145150
func FeatureFloat32Slice(rec *protobuf.Example, key string) []float32 {
146151
f, ok := rec.Features.Feature[key]
147152
if !ok {

0 commit comments

Comments
 (0)