Commit 7e13f568 authored by Jesse Gross's avatar Jesse Gross Committed by Jesse Gross
Browse files

backend: Don't return an error on Close

It is not common to return errors with close/free operations - most
people won't check it and even if they did there's probably not much
that can do. It's better to not give implementations false expectations.
parent 58245413
...@@ -50,7 +50,7 @@ type Context interface { ...@@ -50,7 +50,7 @@ type Context interface {
Forward(Tensor) Forward(Tensor)
Compute(Tensor) Tensor Compute(Tensor) Tensor
Close() error Close()
} }
type Tensor interface { type Tensor interface {
......
...@@ -306,10 +306,9 @@ func (c Context) FromIntSlice(s []int32, shape ...int) (ml.Tensor, error) { ...@@ -306,10 +306,9 @@ func (c Context) FromIntSlice(s []int32, shape ...int) (ml.Tensor, error) {
return fromSlice(c, s, shape, C.GGML_TYPE_I32) return fromSlice(c, s, shape, C.GGML_TYPE_I32)
} }
func (c *Context) Close() error { func (c *Context) Close() {
C.ggml_backend_sched_free(c.sched) C.ggml_backend_sched_free(c.sched)
C.ggml_free(c.ctx) C.ggml_free(c.ctx)
return nil
} }
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