mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Fixed a slow memory leak that occurred when using cuDNN and tensors were created.
This commit is contained in:
parent
84cd330c70
commit
ee09185101
@ -191,15 +191,13 @@ namespace dlib
|
||||
int nc
|
||||
)
|
||||
{
|
||||
if (n == 0 || nr == 0 || nc == 0 || k == 0)
|
||||
if (handle)
|
||||
{
|
||||
if (handle)
|
||||
{
|
||||
cudnnDestroyTensorDescriptor((cudnnTensorDescriptor_t)handle);
|
||||
handle = nullptr;
|
||||
}
|
||||
cudnnDestroyTensorDescriptor((cudnnTensorDescriptor_t)handle);
|
||||
handle = nullptr;
|
||||
}
|
||||
else
|
||||
|
||||
if (n != 0 && nr != 0 && nc != 0 && k != 0)
|
||||
{
|
||||
cudnnTensorDescriptor_t h;
|
||||
CHECK_CUDNN(cudnnCreateTensorDescriptor(&h));
|
||||
|
Loading…
Reference in New Issue
Block a user