File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2972,7 +2972,6 @@ struct Net::Impl : public detail::NetImplBase
2972
2972
ld.outputBlobsWrappers [0 ] = wrap (output);
2973
2973
#endif
2974
2974
std::vector<Range> chrange (output.dims , Range::all ());
2975
-
2976
2975
int ofs = 0 ;
2977
2976
for ( i = 0 ; i < ninputs; i++ )
2978
2977
{
@@ -3000,9 +2999,9 @@ struct Net::Impl : public detail::NetImplBase
3000
2999
if (preferableBackend == DNN_BACKEND_CUDA)
3001
3000
{
3002
3001
auto cuda_wrapper = wrap (output).dynamicCast <CUDABackendWrapper>();
3003
- auto offset = chrange[1 ].start * (output. size [ 2 ] * output.size [ 3 ] );
3004
- auto shape = MatShape{ 1 , chrange[ 1 ]. size (), output. size [ 2 ], output. size [ 3 ]} ;
3005
- cuda_wrapper->update (shape , offset);
3002
+ auto offset = chrange[axis ].start * output_slice. total (axis + 1 , output.dims );
3003
+ auto new_shape = shape (output_slice) ;
3004
+ cuda_wrapper->update (new_shape , offset);
3006
3005
inp_i_data->outputBlobsWrappers [pin.oid ] = cuda_wrapper.staticCast <BackendWrapper>();
3007
3006
}
3008
3007
#endif
You can’t perform that action at this time.
0 commit comments