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.

node_check.cc 4.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**
  2. * Copyright 2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include "parallel/node_check.h"
  17. #include <set>
  18. #include <string>
  19. #include "parallel/ops_info/ops_utils.h"
  20. namespace mindspore {
  21. namespace parallel {
  22. const std::set<std::string> BLACK_LIST = {TUPLE_GETITEM,
  23. MAKE_TUPLE,
  24. J,
  25. LIST_GETITEM,
  26. ARRAY_GETITEM,
  27. TUPLE_SETITEM,
  28. DEPEND,
  29. LIST_SETITEM,
  30. ARRAY_SETITEM,
  31. DICT_GETITEM,
  32. LIST_APPEND,
  33. LIST_MAP,
  34. LIST_REDUCE,
  35. TUPLE_REVERSED,
  36. TILE_SHAPE,
  37. TUPLE_DIV,
  38. TUPLE_TO_ARRAY,
  39. MAKE_LIST,
  40. MAKE_DICT,
  41. MAKE_SLICE,
  42. MAKE_RECORD,
  43. STRING_EQUAL,
  44. VIRTUALLOSS,
  45. RETURN,
  46. ENV_GETITEM,
  47. IDENTITY,
  48. PARTIAL,
  49. ENVSETITEM,
  50. ENVGETITEM,
  51. ENVADD,
  52. MAKEREFKEY,
  53. MAKEREF,
  54. GETREFKEY,
  55. GETREFVALUE,
  56. GETREFORIGIN,
  57. DOT,
  58. IM2COL,
  59. COL2IM,
  60. IM2COLV1,
  61. STATESETITEM,
  62. SCALARSUMMARY,
  63. IMAGESUMMARY,
  64. TENSORSUMMARY,
  65. DEBUG,
  66. HISTOGRAMSUMMARY,
  67. COL2IMV1,
  68. RESOLVE,
  69. BROADCASTGRADIENTARGS,
  70. INVERTPERMUTATION,
  71. CONTROLDEPEND,
  72. DROPOUT_GEN_MASK,
  73. EMBED,
  74. CREATINSTANCE,
  75. ZEROSLIKE,
  76. ASSIGN,
  77. REF_TO_EMBED,
  78. STOP_GRADIENT};
  79. bool IsInBlackList(const PrimitivePtr &prim) {
  80. MS_EXCEPTION_IF_NULL(prim);
  81. return (BLACK_LIST.find(prim->name()) != BLACK_LIST.end());
  82. }
  83. } // namespace parallel
  84. } // namespace mindspore