forked from mindspore-Ecosystem/mindspore
!21329 add print for example
Merge pull request !21329 from lianliguang/code_docs_primitive
This commit is contained in:
commit
e1a9dccac6
|
@ -631,14 +631,14 @@ def constexpr(fn=None, get_instance=True, name=None):
|
|||
>>> def tuple_len(x):
|
||||
... return len(x)
|
||||
...
|
||||
>>> tuple_len(a)
|
||||
>>> print(tuple_len(a))
|
||||
2
|
||||
>>> # make an operator class to calculate tuple len
|
||||
>>> @constexpr(get_instance=False, name="TupleLen")
|
||||
>>> def tuple_len_class(x):
|
||||
... return len(x)
|
||||
...
|
||||
>>> tuple_len_class()(a)
|
||||
>>> print(tuple_len_class()(a))
|
||||
2
|
||||
"""
|
||||
|
||||
|
|
Loading…
Reference in New Issue