You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (tsTensor) Drop() (errerror) {
if!ts.MustDefined() {
returnnil
}
lib.AtFree(ts.ctensor)
iferr=TorchErr(); err!=nil {
returnerr
}
// NOTE. assign to a new undefined tensor, then check `ts.MustDefined`// before deleting at C land. Hence `Drop` method can be called// multiple times without worrying about double C memory delete panic.// Other pattern is `defer ts.MustDrop()` whenever a tensor is created.ts=NewTensor()
returnnil
}
The text was updated successfully, but these errors were encountered:
Make ts.Drop() can be called multiple times.
The text was updated successfully, but these errors were encountered: