Skip to content

Commit

Permalink
clean a little bit code.
Browse files Browse the repository at this point in the history
  • Loading branch information
xutianbing committed Jan 12, 2017
1 parent 86fa8c0 commit df66957
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion paddle/function/ContextProjectionOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class ContextProjectionBackwardFunc : public FunctionBase {
/// input grad and output grad have the same batch_size
CHECK_EQ(inouts[0].dims_[0], inputs[1].dims_[0]);
/// dim of output = dim of input * context_length
CHECK_EQ(inputs[1].dims_[1], inputs[0].dims_[1] * context_length_);
CHECK_EQ(inputs[1].dims_[1], inouts[0].dims_[1] * context_length_);

typename SequenceT<Device>::type seq_vec(
inputs[0].dims_[0], reinterpret_cast<int*>(inputs[0].getData()));
Expand Down
2 changes: 1 addition & 1 deletion paddle/function/ContextProjectionOpGpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ __global__ void KeContextProjectionBackwardWeight(const real* out_grad,
for (int seqId = idy; seqId < num_sequences; seqId += THREADS_Y) {
int seq_start = sequence[seqId];
int seq_end = sequence[seqId+1];
output_r = const_cast<real*>(out_grad)
output_r = const_cast<real*>(out_grad)
+ seq_start * w_dim * context_length;
if (context_start < 0) {
Expand Down

0 comments on commit df66957

Please sign in to comment.