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.

__init__.py 2.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright 2020 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # ============================================================================
  15. """
  16. Operators can be used in the construct function of Cell.
  17. Examples:
  18. >>> from mindspore.ops import operations as P
  19. >>> from mindspore.ops import composite as C
  20. >>> from mindspore.ops import functional as F
  21. >>> import mindspore.ops as ops
  22. Note:
  23. - The Primitive operators in operations need to be used after instantiation.
  24. - The composite operators are the pre-defined combination of operators.
  25. - The functional operators are the pre-instantiated Primitive operators, which can be used directly as a function.
  26. - For functional operators usage, please refer to
  27. https://gitee.com/mindspore/mindspore/blob/master/mindspore/ops/functional.py
  28. """
  29. from .primitive import Primitive, PrimitiveWithInfer, prim_attr_register
  30. from .vm_impl_registry import get_vm_impl_fn, vm_impl_registry
  31. from .op_info_register import op_info_register, AkgGpuRegOp, AkgAscendRegOp, AiCPURegOp, TBERegOp, DataType
  32. from .primitive import constexpr
  33. from . import composite, operations, functional
  34. from . import signature
  35. from .composite import *
  36. from .operations import *
  37. from .functional import *
  38. __primitive__ = [
  39. "prim_attr_register", "Primitive", "PrimitiveWithInfer", "signature"
  40. ]
  41. __all__ = ["get_vm_impl_fn", "vm_impl_registry",
  42. "op_info_register", "AkgGpuRegOp", "AkgAscendRegOp", "AiCPURegOp", "TBERegOp", "DataType",
  43. "constexpr"]
  44. __all__.extend(__primitive__)
  45. __all__.extend(composite.__all__)
  46. __all__.extend(operations.__all__)
  47. __all__.extend(functional.__all__)