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 1.8 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. less,
  25. less_equal,
  26. log,
  27. maximum,
  28. minimum,
  29. mod,
  30. multiply,
  31. power,
  32. relu,
  33. round,
  34. sigmoid,
  35. sin,
  36. subtract,
  37. tanh,
  38. )
  39. from .graph import add_extra_vardep, add_update, grad
  40. from .loss import (
  41. binary_cross_entropy,
  42. cross_entropy,
  43. cross_entropy_with_softmax,
  44. l1_loss,
  45. nll_loss,
  46. square_loss,
  47. triplet_margin_loss,
  48. )
  49. from .math import argmax, argmin, max, mean, min, norm, prod, sqrt, sum
  50. from .nn import (
  51. assert_equal,
  52. avg_pool2d,
  53. batch_norm2d,
  54. batched_matrix_mul,
  55. conv2d,
  56. dropout,
  57. embedding,
  58. eye,
  59. flatten,
  60. identity,
  61. indexing_one_hot,
  62. interpolate,
  63. leaky_relu,
  64. linear,
  65. matrix_mul,
  66. max_pool2d,
  67. one_hot,
  68. prelu,
  69. roi_align,
  70. roi_pooling,
  71. softmax,
  72. warp_perspective,
  73. )
  74. from .sort import argsort, sort, top_k
  75. from .tensor import (
  76. add_axis,
  77. broadcast_to,
  78. concat,
  79. dimshuffle,
  80. gather,
  81. linspace,
  82. remove_axis,
  83. reshape,
  84. scatter,
  85. shapeof,
  86. transpose,
  87. where,
  88. zeros_like,
  89. )
  90. from .utils import accuracy, zero_grad
  91. # delete namespace
  92. # pylint: disable=undefined-variable
  93. del elemwise, graph, loss, math, nn, tensor # type: ignore[name-defined]

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

Contributors (1)