@@ -108,21 +108,18 @@ __global__ void SetVariance(T* out,
108108
109109template <typename T, typename Context>
110110void PriorBoxKernel (const Context& ctx,
111- const DenseTensor& x ,
112- const DenseTensor& y ,
111+ const DenseTensor& input ,
112+ const DenseTensor& image ,
113113 const std::vector<float >& min_sizes,
114- const std::vector<float >& max_sizes,
115114 const std::vector<float >& aspect_ratios,
116115 const std::vector<float >& variances,
116+ const std::vector<float >& max_sizes,
117117 bool flip,
118118 bool clip,
119119 float step_w,
120120 float step_h,
121121 float offset,
122122 bool min_max_aspect_ratios_order,
123- bool use_mkldnn,
124- bool use_quantizer,
125- const std::string& mkldnn_data_type,
126123 DenseTensor* out,
127124 DenseTensor* var) {
128125 std::vector<float > new_aspect_ratios;
@@ -132,11 +129,11 @@ void PriorBoxKernel(const Context& ctx,
132129 T new_step_h = static_cast <T>(step_h);
133130 T new_offset = static_cast <T>(offset);
134131
135- auto im_width = y .dims ()[3 ];
136- auto im_height = y .dims ()[2 ];
132+ auto im_width = image .dims ()[3 ];
133+ auto im_height = image .dims ()[2 ];
137134
138- auto width = x .dims ()[3 ];
139- auto height = x .dims ()[2 ];
135+ auto width = input .dims ()[3 ];
136+ auto height = input .dims ()[2 ];
140137
141138 T step_width, step_height;
142139 if (new_step_w == 0 || new_step_h == 0 ) {
@@ -159,8 +156,8 @@ void PriorBoxKernel(const Context& ctx,
159156
160157 auto stream = ctx.stream ();
161158
162- out-> mutable_data <T>(ctx. GetPlace () );
163- var-> mutable_data <T>(ctx. GetPlace () );
159+ ctx. template Alloc <T>(out );
160+ ctx. template Alloc <T>(var );
164161
165162 DenseTensor r;
166163 paddle::framework::TensorFromVector (new_aspect_ratios, ctx, &r);
0 commit comments