refine reallocate of workspace size, test=develop (#19843)

expand_as_op_1
Zeng Jinle 5 years ago committed by GitHub
parent 71b2ed61bc
commit 5eb381a3e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -218,6 +218,8 @@ class CudnnWorkspaceHandle {
if (required_workspace_bytes <= WorkspaceSize()) {
return;
}
// reset allocation first before re-allocate to save memory
allocation_.reset();
allocation_ = memory::Alloc(device_context_, required_workspace_bytes);
}

Loading…
Cancel
Save