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.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # -*- coding: utf-8 -*-
  2. # MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  3. #
  4. # Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
  5. #
  6. # Unless required by applicable law or agreed to in writing,
  7. # software distributed under the License is distributed on an
  8. # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. # pylint: disable=redefined-builtin
  10. from .elemwise import (
  11. abs,
  12. add,
  13. arccos,
  14. arcsin,
  15. ceil,
  16. clamp,
  17. cos,
  18. divide,
  19. equal,
  20. exp,
  21. floor,
  22. greater,
  23. greater_equal,
  24. isinf,
  25. isnan,
  26. less,
  27. less_equal,
  28. log,
  29. maximum,
  30. minimum,
  31. mod,
  32. multiply,
  33. power,
  34. relu,
  35. round,
  36. sigmoid,
  37. sin,
  38. subtract,
  39. tanh,
  40. )
  41. from .graph import add_extra_vardep, add_update, grad
  42. from .loss import (
  43. binary_cross_entropy,
  44. cross_entropy,
  45. cross_entropy_with_softmax,
  46. hinge_loss,
  47. l1_loss,
  48. nll_loss,
  49. smooth_l1_loss,
  50. square_loss,
  51. triplet_margin_loss,
  52. )
  53. from .math import (
  54. argmax,
  55. argmin,
  56. logsumexp,
  57. max,
  58. mean,
  59. min,
  60. norm,
  61. normalize,
  62. prod,
  63. sqrt,
  64. sum,
  65. )
  66. from .nn import (
  67. assert_equal,
  68. avg_pool2d,
  69. batch_norm2d,
  70. batched_matrix_mul,
  71. conv2d,
  72. conv_transpose2d,
  73. dropout,
  74. embedding,
  75. eye,
  76. flatten,
  77. identity,
  78. indexing_one_hot,
  79. interpolate,
  80. leaky_relu,
  81. linear,
  82. local_conv2d,
  83. matrix_mul,
  84. max_pool2d,
  85. one_hot,
  86. prelu,
  87. roi_align,
  88. roi_pooling,
  89. softmax,
  90. softplus,
  91. sync_batch_norm,
  92. warp_perspective,
  93. )
  94. from .quantized import conv_bias_activation
  95. from .sort import argsort, sort, top_k
  96. from .tensor import (
  97. add_axis,
  98. arange,
  99. broadcast_to,
  100. concat,
  101. cond_take,
  102. dimshuffle,
  103. gather,
  104. linspace,
  105. remove_axis,
  106. reshape,
  107. scatter,
  108. shapeof,
  109. transpose,
  110. where,
  111. zeros_like,
  112. )
  113. from .utils import accuracy, zero_grad
  114. # delete namespace
  115. # pylint: disable=undefined-variable
  116. del elemwise, graph, loss, math, nn, tensor # type: ignore[name-defined]

MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台