Commit d223f3b6 authored by Jesse Gross's avatar Jesse Gross Committed by Jesse Gross
Browse files

ggml-backend: Close on nil should be a no-op

parent 60830695
...@@ -327,8 +327,10 @@ func (c Context) FromIntSlice(s []int32, shape ...int) (ml.Tensor, error) { ...@@ -327,8 +327,10 @@ func (c Context) FromIntSlice(s []int32, shape ...int) (ml.Tensor, error) {
} }
func (c *Context) Close() { func (c *Context) Close() {
C.ggml_backend_sched_free(c.sched) if c != nil {
C.ggml_free(c.ctx) C.ggml_backend_sched_free(c.sched)
C.ggml_free(c.ctx)
}
} }
type Tensor struct { type Tensor struct {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment