title: dim() called on undefined Tensor (dim at ../c10/core/UndefinedTensorImpl.cpp:24) in Libtorch C++
body: <p>I get the error(shown below) when executing an image.
  I used Python to trace the Yolo model and the traced file in the C++ environment gives the error for only one image.
  I guess the error might be due to the image not having any object detection.</p>
  <pre><code>**terminate called after throwing an instance of 'c10::Error'
    what():  dim() called on undefined Tensor (dim at ../c10/core/UndefinedTensorImpl.cpp:24)
  frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) + 0x6a (0x7f8e4ec3baaa in libtorch/lib/libc10.so)
  frame #1: c10::UndefinedTensorImpl::dim() const + 0x258 (0x7f8e4ec33258 in libtorch/lib/libc10.so)
  frame #2: at::native::size(at::Tensor const&amp;, long) + 0x15 (0x7f8e408ca4a5 in libtorch/lib/libtorch_cpu.so)
  frame #3: &lt;unknown function&gt; + 0x3464a (0x556c2485164a in ./Torchimport_YOLO3)
  frame #4: &lt;unknown function&gt; + 0x2fb1b (0x556c2484cb1b in ./Torchimport_YOLO3)
  frame #5: long c10::Dispatcher::callUnboxed&lt;long, at::Tensor const&amp;, long&gt;(c10::OperatorHandle const&amp;, at::Tensor const&amp;, long) const + 0x8f (0x556c24847e41 in ./Torchimport_YOLO3)
  frame #6: &lt;unknown function&gt; + 0x244f3 (0x556c248414f3 in ./Torchimport_YOLO3)
  frame #7: at::Tensor::size(long) const + 0x83 (0x556c24837c13 in ./Torchimport_YOLO3)
  frame #8: &lt;unknown function&gt; + 0xeef1 (0x556c2482bef1 in ./Torchimport_YOLO3)
  frame #9: __libc_start_main + 0xe7 (0x7f8e01096b97 in /lib/x86_64-linux-gnu/libc.so.6)
  frame #10: &lt;unknown function&gt; + 0xa65a (0x556c2482765a in ./Torchimport_YOLO3)**
  </code></pre>