mirror of
https://github.com/ollama/ollama.git
synced 2026-10-21 02:51:35 +00:00
ggml-backend: Close on nil should be a no-op
This commit is contained in:
parent
60830695c2
commit
d223f3b697
1 changed files with 4 additions and 2 deletions
|
|
@ -327,8 +327,10 @@ func (c Context) FromIntSlice(s []int32, shape ...int) (ml.Tensor, error) {
|
|||
}
|
||||
|
||||
func (c *Context) Close() {
|
||||
C.ggml_backend_sched_free(c.sched)
|
||||
C.ggml_free(c.ctx)
|
||||
if c != nil {
|
||||
C.ggml_backend_sched_free(c.sched)
|
||||
C.ggml_free(c.ctx)
|
||||
}
|
||||
}
|
||||
|
||||
type Tensor struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue