Browse Source

!6410 clear up codedex of C++

Merge pull request !6410 from lilei/modify_bug
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
c54c4d644c
4 changed files with 0 additions and 10 deletions
  1. +0
    -2
      mindspore/ccsrc/pybind_api/random_normal/philox_generator.cc
  2. +0
    -2
      mindspore/ccsrc/pybind_api/random_normal/philox_generator.h
  3. +0
    -3
      mindspore/ccsrc/pybind_api/random_normal/random_cpu_kernel.cc
  4. +0
    -3
      mindspore/ccsrc/pybind_api/random_normal/random_cpu_kernel.h

+ 0
- 2
mindspore/ccsrc/pybind_api/random_normal/philox_generator.cc View File

@@ -16,7 +16,6 @@
#include "pybind_api/random_normal/philox_generator.h"

namespace mindspore {

void PhiloxGenerator::Jump() {
if ((++counter_[0] == 0) && (++counter_[1] == 0) && (++counter_[2] == 0)) {
++counter_[3];
@@ -68,5 +67,4 @@ std::array<uint32_t, gResultNum> PhiloxGenerator::operator()() {
Jump();
return counter_;
}

} // namespace mindspore

+ 0
- 2
mindspore/ccsrc/pybind_api/random_normal/philox_generator.h View File

@@ -20,7 +20,6 @@
#include <array>

namespace mindspore {

static constexpr int gResultNum = 4;
class PhiloxGenerator {
public:
@@ -49,7 +48,6 @@ class PhiloxGenerator {
std::array<uint32_t, 2> key_var_;
static constexpr std::array<uint32_t, gResultNum> keyConstant = {0xD2511F53, 0x9E3779B9, 0xCD9E8D57, 0xBB67AE85};
};

} // namespace mindspore

#endif // PYBIND_API_API_IR_RANDOM_NORMAL_PHILOX_GENERATOR_H_

+ 0
- 3
mindspore/ccsrc/pybind_api/random_normal/random_cpu_kernel.cc View File

@@ -20,7 +20,6 @@
#include "runtime/device/cpu/cpu_device_address.h"

namespace mindspore {

bool InitRandomNormal(float mean, float stddev, std::vector<int64_t> out_shape, int64_t seed,
const py::object &output_tensor) {
if (out_shape.size() == 0) {
@@ -53,7 +52,6 @@ bool InitRandomNormal(float mean, float stddev, std::vector<int64_t> out_shape,
threads[thread_num - 1] =
std::thread(mindspore::FillRandoms<mindspore::NormalDistribution<mindspore::PhiloxGenerator, float>>, generator,
offset_ptr, total_count - (thread_num - 1) * batchSize, thread_num - 1);

} else {
threads[0] = std::thread(mindspore::FillRandoms<mindspore::NormalDistribution<mindspore::PhiloxGenerator, float>>,
generator, start_ptr, total_count, 0);
@@ -66,5 +64,4 @@ bool InitRandomNormal(float mean, float stddev, std::vector<int64_t> out_shape,

REGISTER_PYBIND_DEFINE(random_normal,
([](py::module *const m) { (void)m->def("random_normal", &InitRandomNormal, "testnormal"); }));

} // namespace mindspore

+ 0
- 3
mindspore/ccsrc/pybind_api/random_normal/random_cpu_kernel.h View File

@@ -25,7 +25,6 @@
namespace py = pybind11;

namespace mindspore {

template <class T, typename vartype>
class NormalDistribution;
template <class T>
@@ -86,10 +85,8 @@ bool FillRandoms(PhiloxGenerator generator, float *output, int64_t vet_size, int
}
return true;
}

bool InitRandomNormal(float mean, float stddev, std::vector<int64_t> out_shape, int64_t seed,
const py::object &output_tensor);

} // namespace mindspore

#endif // PYBIND_API_API_IR_RANDOM_NORMAL_RANDOM_CPU_KERNEL_H_

Loading…
Cancel
Save