Skip to content

Commit

Permalink
fix typo in TH_APPLY for _dimOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
albanD authored and soumith committed Apr 20, 2017
1 parent 331219c commit e788ea4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions THTensorApply.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
TENSOR##_sizes = TENSOR##_counter + TENSOR##_dim; \
TENSOR##_strides = TENSOR##_counter + 2*TENSOR##_dim; \
TH_TENSOR_dim_index = TENSOR##_dim-1; \
TENSOR##_dimOffset = (DIM == TENSOR##_dim-1) ? &TENSOR##_i : &TENSOR##_counter[DIM]; \
TENSOR##_dimOffset = (DIM == TENSOR->nDimension-1) ? &TENSOR##_i : &TENSOR##_counter[DIM]; \
TENSOR##_sizes[TH_TENSOR_dim_index] = TENSOR->size[TENSOR->nDimension-1]; \
TENSOR##_strides[TH_TENSOR_dim_index] = TENSOR->stride[TENSOR->nDimension-1]; \
/* TENSOR##_counter tracks where we are in the storage. The offset into the */ \
Expand All @@ -81,7 +81,7 @@
for(TENSOR##_i = TENSOR->nDimension-2; TENSOR##_i >= 0; --TENSOR##_i) { \
if (TENSOR->stride[TENSOR##_i] == TENSOR->stride[TENSOR##_i+1] * TENSOR->size[TENSOR##_i+1] && TENSOR##_i != DIM && TENSOR##_i+1 != DIM) { \
TENSOR##_sizes[TH_TENSOR_dim_index] = TENSOR->size[TENSOR##_i] * TENSOR##_sizes[TH_TENSOR_dim_index]; \
if (DIM != TENSOR##_dim-1 && TENSOR##_i < DIM) \
if (DIM != TENSOR->nDimension-1 && TENSOR##_i < DIM) \
TENSOR##_dimOffset--; \
} else { \
--TH_TENSOR_dim_index; \
Expand Down

0 comments on commit e788ea4

Please sign in to comment.