Skip to content

Commit 04afbfd

Browse files
committed
optimization of index select
1 parent e6536f0 commit 04afbfd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

paddle/fluid/operators/index_select_op.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ void IndexSelectGradInner(const framework::ExecutionContext& context,
196196
auto src = input_data + input_start_offset + j * slice_size;
197197
auto p_out = p_output + output_start_offset + index_value * slice_size;
198198
auto dst = out_data + output_start_offset + index_value * slice_size;
199+
#if ((!defined __NVCC__) && (!defined __HIPCC__))
199200
IndexSelectAdd<DeviceContext, T> index_select_add;
200201
index_select_add(context, slice_size, src, p_out, dst);
202+
#endif
201203
}
202204
}
203205
x_grad->Resize(output_dim);

0 commit comments

Comments
 (0)