File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -701,18 +701,12 @@ RefCountedPtr<TensorListWrapper<Backend>> Wrap(std::shared_ptr<TensorList<Backen
701
701
702
702
template <typename Backend>
703
703
const std::shared_ptr<Tensor<Backend>> &ITensor::Unwrap () const & {
704
- if (auto *self = dynamic_cast <const TensorWrapper<Backend> *>(this ))
705
- return self->NativePtr ();
706
- else
707
- return nullptr ;
704
+ return dynamic_cast <const TensorWrapper<Backend> &>(this ).NativePtr ();
708
705
}
709
706
710
707
template <typename Backend>
711
708
const std::shared_ptr<TensorList<Backend>> &ITensorList::Unwrap () const & {
712
- if (auto *self = dynamic_cast <const TensorListWrapper<Backend> *>(this ))
713
- return self->NativePtr ();
714
- else
715
- return nullptr ;
709
+ return dynamic_cast <const TensorListWrapper<Backend> &>(this ).NativePtr ();
716
710
}
717
711
718
712
ITensor *ToPointer (daliTensor_h handle);
You can’t perform that action at this time.
0 commit comments