Skip to content

Commit

Permalink
Missed ptrdiff cast in sample op.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBroughton committed Jul 24, 2020
1 parent 7605cac commit 1a5581b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tensorflow_quantum/core/ops/tfq_simulate_samples_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,14 @@ class TfqSimulateSamplesOp : public tensorflow::OpKernel {
bool val = 0;
while (q_ind < nq) {
val = samples[j] & mask;
(*output_tensor)(i, j, max_num_qubits - q_ind - 1) = val;
(*output_tensor)(
i, j, static_cast<ptrdiff_t>(max_num_qubits - q_ind - 1)) = val;
q_ind++;
mask <<= 1;
}
while (q_ind < max_num_qubits) {
(*output_tensor)(i, j, max_num_qubits - q_ind - 1) = -2;
(*output_tensor)(
i, j, static_cast<ptrdiff_t>(max_num_qubits - q_ind - 1)) = -2;
q_ind++;
}
}
Expand Down

0 comments on commit 1a5581b

Please sign in to comment.