gorgonia.org/gorgonia@v0.9.17/cuda/errors.go (about) 1 package cuda 2 3 import "fmt" 4 5 // oomError represents an Out of tensor.Memory error. It is typically used for CUDA related machine work 6 type oomError struct { 7 res int64 8 allocated int64 9 } 10 11 func (e oomError) Reserved() int64 { return e.res } 12 func (e oomError) Allocated() int64 { return e.allocated } 13 func (e oomError) Error() string { return fmt.Sprintf("allocated/reserved: %v/%v", e.allocated, e.res) } 14 15 const ( 16 typeMismatch = "TypeMismatch: a %T and b %T" 17 shapeMismatch = "Shape mismatch. Expected %v. Got %v" 18 )