!13356 Fix codex issues

From: @lixiachen
Reviewed-by: @nsyca,@robingrosman
Signed-off-by: @robingrosman
pull/13356/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 7838f8570b

@ -1293,7 +1293,8 @@ CacheServer::Builder::Builder()
num_workers_(std::thread::hardware_concurrency() / 2),
port_(50052),
shared_memory_sz_in_gb_(kDefaultSharedMemorySize),
memory_cap_ratio_(kDefaultMemoryCapRatio) {
memory_cap_ratio_(kDefaultMemoryCapRatio),
log_level_(1) {
if (num_workers_ == 0) {
num_workers_ = 1;
}

@ -80,6 +80,5 @@ Status CacheLookupNode::SamplerBuild(std::shared_ptr<SamplerRT> *const out) {
*out = std::shared_ptr<SamplerRT>(lookup_op);
return Status::OK();
}
} // namespace dataset
} // namespace mindspore

@ -25,7 +25,6 @@
namespace mindspore {
namespace dataset {
class CacheLookupNode : public DatasetNode, public SamplerObj {
public:
/// \brief Constructor

@ -65,6 +65,5 @@ Status CacheMergeNode::AcceptAfter(IRNodePass *const p, bool *const modified) {
// Downcast shared pointer then call visitor
return p->VisitAfter(shared_from_base<CacheMergeNode>(), modified);
}
} // namespace dataset
} // namespace mindspore

@ -24,7 +24,6 @@
namespace mindspore {
namespace dataset {
class CacheMergeNode : public DatasetNode {
public:
/// \brief Constructor

@ -72,6 +72,5 @@ Status CacheNode::AcceptAfter(IRNodePass *const p, bool *const modified) {
// Downcast shared pointer then call visitor
return p->VisitAfter(shared_from_base<CacheNode>(), modified);
}
} // namespace dataset
} // namespace mindspore

@ -24,7 +24,6 @@
namespace mindspore {
namespace dataset {
class CacheNode : public DatasetNode {
public:
/// \brief Constructor

@ -213,7 +213,7 @@ Status MindDataNode::Accept(IRNodePass *const p, bool *const modified) {
}
// Visitor accepting method for IRNodePass
Status MindDataNode::AcceptAfter(IRNodePass *p, bool *const modified) {
Status MindDataNode::AcceptAfter(IRNodePass *const p, bool *const modified) {
// Downcast shared pointer then call visitor
return p->VisitAfter(shared_from_base<MindDataNode>(), modified);
}

@ -96,13 +96,13 @@ class MindDataNode : public MappableSourceNode {
/// \param[in] p The node to visit
/// \param[out] modified Indicator if the node was modified
/// \return Status of the node visit
Status Accept(IRNodePass *p, bool *const modified) override;
Status Accept(IRNodePass *const p, bool *const modified) override;
/// \brief Base-class override for accepting IRNodePass visitor
/// \param[in] p The node to visit
/// \param[out] modified Indicator if the node was modified
/// \return Status of the node visit
Status AcceptAfter(IRNodePass *p, bool *const modified) override;
Status AcceptAfter(IRNodePass *const p, bool *const modified) override;
private:
std::string dataset_file_; // search_for_pattern_ will be true in this mode

@ -148,13 +148,13 @@ Status RandomNode::SetupSamplerForCache(std::shared_ptr<SamplerObj> *sampler) {
}
// Visitor accepting method for IRNodePass
Status RandomNode::Accept(IRNodePass *p, bool *const modified) {
Status RandomNode::Accept(IRNodePass *const p, bool *const modified) {
// Downcast shared pointer then call visitor
return p->Visit(shared_from_base<RandomNode>(), modified);
}
// Visitor accepting method for IRNodePass
Status RandomNode::AcceptAfter(IRNodePass *p, bool *const modified) {
Status RandomNode::AcceptAfter(IRNodePass *const p, bool *const modified) {
// Downcast shared pointer then call visitor
return p->VisitAfter(shared_from_base<RandomNode>(), modified);
}

@ -115,13 +115,13 @@ class RandomNode : public NonMappableSourceNode {
/// \param[in] p The node to visit
/// \param[out] modified Indicator if the node was modified
/// \return Status of the node visit
Status Accept(IRNodePass *p, bool *const modified) override;
Status Accept(IRNodePass *const p, bool *const modified) override;
/// \brief Base-class override for accepting IRNodePass visitor
/// \param[in] p The node to visit
/// \param[out] modified Indicator if the node was modified
/// \return Status of the node visit
Status AcceptAfter(IRNodePass *p, bool *const modified) override;
Status AcceptAfter(IRNodePass *const p, bool *const modified) override;
private:
/// \brief A quick inline for producing a random number between (and including) min/max

@ -462,7 +462,7 @@ TEST_F(MindDataTestCacheOp, DISABLED_TestCacheRandomDataCApi) {
schema->add_column("image", mindspore::DataType::kNumberTypeUInt8, {2});
schema->add_column("label", mindspore::DataType::kNumberTypeUInt8, {1});
std::shared_ptr<Dataset> ds = RandomData(4, schema, {}, some_cache);
std::shared_ptr<Dataset> ds = RandomData(8, schema, {}, some_cache);
EXPECT_NE(ds, nullptr);
// Create a Repeat operation on ds
@ -485,7 +485,7 @@ TEST_F(MindDataTestCacheOp, DISABLED_TestCacheRandomDataCApi) {
iter->GetNextRow(&row);
}
EXPECT_EQ(i, 8);
EXPECT_EQ(i, 16);
// Manually terminate the pipeline
iter->Stop();

@ -55,7 +55,9 @@ cmd="${CACHE_ADMIN} --start --spilldir /path_that_does_not_exist"
CacheAdminCmd "${cmd}" 1
HandleRcExit $? 0 0
# start cache server twice
# stop cache server first to test start
StopServer
# start cache server
StartServer
HandleRcExit $? 1 1
# start the cache server again, however, this time we expect an error
@ -200,7 +202,7 @@ if [ "$EUID" -ne 0 ]; then
fi
# illegal log level
cmd="${CACHE_ADMIN} --start -l 4"
cmd="${CACHE_ADMIN} --start -l 5"
CacheAdminCmd "${cmd}" 1
HandleRcExit $? 0 0
cmd="${CACHE_ADMIN} --start -l -1"

@ -804,11 +804,11 @@ def test_cache_map_parameter_check():
with pytest.raises(ValueError) as err:
ds.DatasetCache(session_id=1, size=0, port=0)
assert "Input port is not within the required interval of (1025 to 65535)" in str(err.value)
assert "Input port is not within the required interval of [1025, 65535]" in str(err.value)
with pytest.raises(ValueError) as err:
ds.DatasetCache(session_id=1, size=0, port=65536)
assert "Input port is not within the required interval of (1025 to 65535)" in str(err.value)
assert "Input port is not within the required interval of [1025, 65535]" in str(err.value)
with pytest.raises(TypeError) as err:
ds.ImageFolderDataset(dataset_dir=DATA_DIR, cache=True)

Loading…
Cancel
Save