Skip to content

Commit

Permalink
Fix multiplie initialization attempts in optical flow operator.
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Zientkiewicz <[email protected]>
  • Loading branch information
mzient committed Sep 6, 2024
1 parent d5b93c0 commit 8d8143d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dali/operators/sequence/optical_flow/optical_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ class OpticalFlow : public StatelessOperator<Backend> {
void of_lazy_init(size_t width, size_t height, size_t channels, DALIImageType image_type,
int device_id, cudaStream_t stream) {
if (!optical_flow_) {
optical_flow_ = std::make_unique<optical_flow::OpticalFlowImpl>(
auto flow = std::make_unique<optical_flow::OpticalFlowImpl>(
of_params_, width, height, channels, image_type, device_id, stream);
optical_flow_->Init(of_params_);
flow->Init(of_params_);
optical_flow_ = std::move(flow);
}
}

Expand Down

0 comments on commit 8d8143d

Please sign in to comment.