Skip to content

Commit

Permalink
Fix delete[]/new[] mismatch in pytorch binding
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Richardson authored and sean.narenthiran committed Jul 27, 2018
1 parent 7fcbf65 commit 025cc42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytorch_binding/src/binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ extern "C" int cpu_ctc(THFloatTensor *probs,
probs_size, minibatch_size,
options, &cpu_size_bytes);

float* cpu_workspace = (float*) new unsigned char[cpu_size_bytes];
float* cpu_workspace = new float[cpu_size_bytes / sizeof(float)];

compute_ctc_loss(probs_ptr, grads_ptr,
labels_ptr, label_sizes_ptr,
sizes_ptr, probs_size,
minibatch_size, costs_ptr,
cpu_workspace, options);

delete cpu_workspace;
delete[] cpu_workspace;
return 1;
}

Expand Down

0 comments on commit 025cc42

Please sign in to comment.