added
This commit is contained in:
parent
66599380d4
commit
6aa57478f5
|
@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- reworked `ts.Format()`
|
||||
- Added conv2d benchmark
|
||||
- Fixed #88 memory leak at `example/char-rnn`
|
||||
- Added missing tensor `Stride()`
|
||||
- Added missing tensor `Stride()` and `MustDataPtr()`
|
||||
|
||||
## [Nofix]
|
||||
- ctype `long` caused compiling error in MacOS as noted on [#44]. Not working on linux box.
|
||||
|
|
|
@ -674,6 +674,15 @@ func (ts *Tensor) DataPtr() (unsafe.Pointer, error) {
|
|||
return datPtr, nil
|
||||
}
|
||||
|
||||
func (ts *Tensor) MustDataPtr() unsafe.Pointer {
|
||||
p, err := ts.DataPtr()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
// Defined returns true is the tensor is defined.
|
||||
func (ts *Tensor) Defined() (bool, error) {
|
||||
state := lib.AtDefined(ts.ctensor)
|
||||
|
|
Loading…
Reference in New Issue
Block a user