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.

base.h 1.7 kB

5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Copyright 2019 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. #ifndef DATAVISUAL_UTILS_CRC32_BASE_H_
  17. #define DATAVISUAL_UTILS_CRC32_BASE_H_
  18. #include <memory>
  19. #include <string>
  20. #include "securec/include/securec.h"
  21. using string = std::string;
  22. using int8 = int8_t;
  23. using int16 = int16_t;
  24. using int32 = int32_t;
  25. using int64 = int64_t;
  26. using uint8 = uint8_t;
  27. using uint16 = uint16_t;
  28. using uint32 = uint32_t;
  29. using uint64 = uint64_t;
  30. // check the null point, Only log it in if(): The value is null
  31. #define EXCEPT_CHECK_NULL(value) \
  32. do { \
  33. if (value == nullptr) { \
  34. break; \
  35. } \
  36. } while (0)
  37. // implement common define function
  38. // Get the 32 bits align value
  39. inline uint32 DecodeFixed32(const char* ptr) {
  40. uint32 result = 0;
  41. if (EOK != memcpy_s(&result, sizeof(result), ptr, sizeof(result))) {
  42. return result;
  43. }
  44. return result;
  45. }
  46. // Used to fetch a naturally-aligned 32-bit word in little endian byte-order
  47. inline uint32 LE_LOAD32(const uint8_t* p) { return DecodeFixed32(reinterpret_cast<const char*>(p)); }
  48. #endif // DATAVISUAL_UTILS_CRC32_BASE_H_

MindInsight为MindSpore提供了简单易用的调优调试能力。在训练过程中,可以将标量、张量、图像、计算图、模型超参、训练耗时等数据记录到文件中,通过MindInsight可视化页面进行查看及分析。