25 #ifndef TVM_SUPPORT_WITH_H_ 26 #define TVM_SUPPORT_WITH_H_ 28 #include <dmlc/common.h> 56 template <
typename ContextType>
63 template <
typename... Args>
64 explicit With(Args&&... args) : ctx_(
std::forward<Args>(args)...) {
65 ctx_.EnterWithScope();
68 ~With() DMLC_THROW_EXCEPTION { ctx_.ExitWithScope(); }
76 #endif // TVM_SUPPORT_WITH_H_ ~With() DMLC_THROW_EXCEPTION
destructor, leaves the scope of the context.
Definition: with.h:68
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
With(Args &&... args)
constructor. Enter the scope of the context.
Definition: with.h:64
Definition: loop_state.h:456
RAII wrapper function to enter and exit a context object similar to python's with syntax...
Definition: with.h:57