You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/09/22 18:39:03 UTC

[GitHub] [tvm] junrushao commented on a diff in pull request #12875: [TIR] Allow missing TensorIntrin in registry lookup

junrushao commented on code in PR #12875:
URL: https://github.com/apache/tvm/pull/12875#discussion_r977974861


##########
include/tvm/tir/function.h:
##########
@@ -233,10 +233,13 @@ class TensorIntrin : public ObjectRef {
   /*!
    * \brief Look up TensorIntrin by name. Raises an exception if not found.
    * \param name The name of the TensorIntrin.
+   * \param allow_missing Whether to allow missing tensor intrin. If false, an exception is raised
+   *    if the tensor intrin is not found.
    * \return The TensorIntrin with the specified name.
-   * \throws This method throws an exception if the TensorIntrin does not exist.
+   * \throws This method throws an exception if the TensorIntrin does not exist and allow_missing is
+   * false.
    */
-  TVM_DLL static TensorIntrin Get(String name);
+  TVM_DLL static TensorIntrin Get(String name, bool allow_missing = false);

Review Comment:
   ```suggestion
     TVM_DLL static Optional<TensorIntrin> Get(String name, bool allow_missing = false);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org