pub fn with_stream<T>( device: &DLDevice, stream: TVMFFIStreamHandle, f: impl FnOnce() -> Result<T>, ) -> Result<T>
call f with the stream set to the given stream