Skip to content

Commit

Permalink
Fix multiple initialization attempts in optical flow operator. (#5624)
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
  • Loading branch information
mzient authored Sep 6, 2024
1 parent b3a1889 commit 4b19d43
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 4b19d43

Please sign in to comment.