You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.constexpr.rst 841 B

12345678910111213
  1. mindspore.ops.constexpr
  2. =======================
  3. .. py:function:: mindspore.ops.constexpr(fn=None, get_instance=True, name=None, reuse_result=True)
  4. 创建PrimiveWithInfer算子,用于在编译时推断值。可以用它定义函数,从而使用构造函数中的常量计算出常量值。
  5. **参数:**
  6. - **fn** (function) - `fn` 用作输出算子的infer_value。默认值:None。
  7. - **get_instance** (bool) - 如果为True,返回算子的实例,否则返回算子的类。默认值:True。
  8. - **name** (str) - 定义算子的名称。如果 `name` 为None,则使用函数名称作为算子名称。默认值:None。
  9. - **reuse_result** (bool) - 如果为True,仅实际执行算子一次,后续调用会直接返回结果。否则每次都实际执行算子来获取结果。默认值:True。