Skip to content

Commit d9ecd15

Browse files
committed
update
1 parent 993a560 commit d9ecd15

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

cbits.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -124,31 +124,31 @@ func (p *Predictor) Close() {
124124
}
125125

126126
func (p *Predictor) StartProfiling(name, metadata string) error {
127-
cname := C.CString(name)
128-
cmetadata := C.CString(metadata)
129-
defer C.free(unsafe.Pointer(cname))
130-
defer C.free(unsafe.Pointer(cmetadata))
131-
C.StartProfilingPytorch(p.ctx, cname, cmetadata)
132-
return nil
127+
cname := C.CString(name)
128+
cmetadata := C.CString(metadata)
129+
defer C.free(unsafe.Pointer(cname))
130+
defer C.free(unsafe.Pointer(cmetadata))
131+
C.StartProfilingPytorch(p.ctx, cname, cmetadata)
132+
return nil
133133

134134
}
135135

136136
func (p *Predictor) EndProfiling() error {
137-
C.EndProfilingPytorch(p.ctx)
138-
return nil
137+
C.EndProfilingPytorch(p.ctx)
138+
return nil
139139
}
140140

141141
func (p *Predictor) DisableProfiling() error {
142-
C.DisableProfilingPytorch(p.ctx)
143-
return nil
142+
C.DisableProfilingPytorch(p.ctx)
143+
return nil
144144
}
145145

146146
func (p *Predictor) ReadProfile() (string, error) {
147-
cstr := C.ReadProfilePytorch(p.ctx)
148-
if cstr == nil {
149-
return "", errors.New("failed to read nil profile")
150-
}
151-
defer C.free(unsafe.Pointer(cstr))
152-
return C.GoString(cstr) nil
147+
cstr := C.ReadProfilePytorch(p.ctx)
148+
if cstr == nil {
149+
return "", errors.New("failed to read nil profile")
150+
}
151+
defer C.free(unsafe.Pointer(cstr))
152+
return C.GoString(cstr), nil
153153

154154
}

init.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package pytorch
22

33
import (
4-
"github.com/rai-project/config"
5-
"github.com/rai-project/logger"
6-
"github.com/sirupsen/logrus"
4+
"github.com/rai-project/config"
5+
"github.com/rai-project/logger"
6+
"github.com/sirupsen/logrus"
77
)
88

99
var (
10-
log *logrus.Entry
10+
log *logrus.Entry
1111
)
1212

1313
func init() {
14-
config.AfterInit(func() {
15-
log = logger.New().WithField("pkg", "go-pytorch")
16-
})
14+
config.AfterInit(func() {
15+
log = logger.New().WithField("pkg", "go-pytorch")
16+
})
1717

1818
}

version.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package pytorch
22

33
var (
4-
Version = "0.0.1"
5-
BuildDate = "undefined"
6-
GitCommit = "undefined"
4+
Version = "0.0.1"
5+
BuildDate = "undefined"
6+
GitCommit = "undefined"
77
)

0 commit comments

Comments
 (0)