forked from mindspore-Ecosystem/mindspore
!4820 Alarm modification
Merge pull request !4820 from shenwei41/sw_master
This commit is contained in:
commit
4ee0bf22c3
|
@ -149,7 +149,7 @@ void Debugger::EnableDebugger() {
|
|||
last_overflow_bin_ = 0;
|
||||
DIR *d;
|
||||
d = opendir(overflow_bin_path_.c_str());
|
||||
if (d) {
|
||||
if (d != nullptr) {
|
||||
struct dirent *dir;
|
||||
while ((dir = readdir(d)) != NULL) {
|
||||
if (dir->d_type == DT_REG) {
|
||||
|
@ -718,9 +718,9 @@ std::vector<std::string> Debugger::CheckOpOverflow() {
|
|||
std::vector<double> bin_list;
|
||||
std::vector<std::string> op_names;
|
||||
DIR *d;
|
||||
struct dirent *dir;
|
||||
struct dirent *dir = nullptr;
|
||||
d = opendir(overflow_bin_path_.c_str());
|
||||
if (d) {
|
||||
if (d != nullptr) {
|
||||
while ((dir = readdir(d)) != NULL) {
|
||||
if (dir->d_type == DT_REG) {
|
||||
std::string file_path = overflow_bin_path_;
|
||||
|
|
|
@ -609,6 +609,7 @@ Status ComputeShuffleSize(int64_t num_files, int64_t num_devices, int64_t num_ro
|
|||
}
|
||||
|
||||
// get the average per file
|
||||
CHECK_FAIL_RETURN_UNEXPECTED(num_files != 0, "The size of dataset_files must greater than 0.");
|
||||
avg_rows_per_file = num_rows / num_files;
|
||||
|
||||
*shuffle_size = std::max(avg_rows_per_file * average_files_multiplier, shuffle_max);
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "minddata/dataset/engine/gnn/node.h"
|
||||
#include "minddata/dataset/util/status.h"
|
||||
#include "minddata/mindrecord/include/shard_reader.h"
|
||||
#include "minddata/dataset/engine/gnn/graph_data_impl.h"
|
||||
namespace mindspore {
|
||||
namespace dataset {
|
||||
namespace gnn {
|
||||
|
@ -49,8 +50,6 @@ using EdgeFeatureMap = std::unordered_map<EdgeType, std::unordered_set<FeatureTy
|
|||
using DefaultNodeFeatureMap = std::unordered_map<FeatureType, std::shared_ptr<Feature>>;
|
||||
using DefaultEdgeFeatureMap = std::unordered_map<FeatureType, std::shared_ptr<Feature>>;
|
||||
|
||||
class GraphDataImpl;
|
||||
|
||||
// this class interfaces with the underlying storage format (mindrecord)
|
||||
// it returns raw nodes and edges via GetNodesAndEdges
|
||||
// it is then the responsibility of graph to construct itself based on the nodes and edges
|
||||
|
|
|
@ -32,7 +32,7 @@ CutMixBatchOp::CutMixBatchOp(ImageBatchFormat image_batch_format, float alpha, f
|
|||
}
|
||||
|
||||
void CutMixBatchOp::GetCropBox(int height, int width, float lam, int *x, int *y, int *crop_width, int *crop_height) {
|
||||
float cut_ratio = 1 - lam;
|
||||
const float cut_ratio = 1 - lam;
|
||||
int cut_w = static_cast<int>(width * cut_ratio);
|
||||
int cut_h = static_cast<int>(height * cut_ratio);
|
||||
std::uniform_int_distribution<int> width_uniform_distribution(0, width);
|
||||
|
@ -116,7 +116,6 @@ Status CutMixBatchOp::Compute(const TensorRow &input, TensorRow *output) {
|
|||
RETURN_IF_NOT_OK(Crop(rand_image, &cropped, x, y, crop_width, crop_height));
|
||||
RETURN_IF_NOT_OK(MaskWithTensor(cropped, &images[i], x, y, crop_width, crop_height, ImageFormat::HWC));
|
||||
label_lam = 1 - (crop_width * crop_height / static_cast<float>(image_shape[1] * image_shape[2]));
|
||||
|
||||
} else {
|
||||
// NCHW Format
|
||||
GetCropBox(static_cast<int32_t>(image_shape[2]), static_cast<int32_t>(image_shape[3]), lam, &x, &y, &crop_width,
|
||||
|
|
|
@ -39,6 +39,8 @@ namespace dataset {
|
|||
class RandomColorOp : public TensorOp {
|
||||
public:
|
||||
RandomColorOp() = default;
|
||||
|
||||
~RandomColorOp() = default;
|
||||
/// \brief Constructor
|
||||
/// \param[in] t_lb lower bound for the random weights
|
||||
/// \param[in] t_ub upper bound for the random weights
|
||||
|
|
Loading…
Reference in New Issue