File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,14 @@ class SequenceSliceGradOpKernel : public framework::OpKernel<T> {
124
124
125
125
const int64_t * offset_data = offset->data <int64_t >();
126
126
const int64_t * length_data = length->data <int64_t >();
127
+ framework::Tensor offset_cpu;
128
+ framework::Tensor length_cpu;
127
129
128
130
if (platform::is_gpu_place (ctx.GetPlace ())) {
129
- framework::Tensor offset_cpu;
130
131
offset_cpu.mutable_data <T>(offset->dims (), platform::CPUPlace ());
131
132
offset_cpu.CopyFrom (*offset, platform::CPUPlace (), ctx.device_context ());
132
133
offset_data = offset_cpu.data <int64_t >();
133
134
134
- framework::Tensor length_cpu;
135
135
length_cpu.mutable_data <T>(length->dims (), platform::CPUPlace ());
136
136
length_cpu.CopyFrom (*length, platform::CPUPlace (), ctx.device_context ());
137
137
length_data = length_cpu.data <int64_t >();
You can’t perform that action at this time.
0 commit comments