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 637 B

4 years ago
4 years ago
123456789101112
  1. mindspore.ops.constexpr
  2. =======================
  3. .. py:function:: mindspore.ops.constexpr(fn=None, get_instance=True, name=None)
  4. 创建PrimiveWithInfer算子,用于在编译时推断值。可以用它定义函数,从而使用构造函数中的常量计算出常量值。
  5. **参数:**
  6. - **fn** (function) - `fn` 用作输出算子的infer_value。默认值:None。
  7. - **get_instance** (bool) - 如果为True,返回算子的实例,否则返回算子的类。默认值:True。
  8. - **name** (str) - 定义算子的名称。如果 `name` 为None,则使用函数名称作为算子名称。默认值:None。