Adding input output as parameter.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @file to_lower.hpp
|
||||
* @author Himanshu Pathak
|
||||
*
|
||||
* Convert a string to lower-case.
|
||||
* Convert a string to lowercase.
|
||||
*
|
||||
* mlpack is free software; you may redistribute it and/or modify it under the
|
||||
* terms of the 3-clause BSD license. You should have received a copy of the
|
||||
@@ -16,18 +16,15 @@ namespace mlpack {
|
||||
namespace util {
|
||||
|
||||
/**
|
||||
* ToLower convert a string into a string of lower case characters
|
||||
* only.
|
||||
* Convert a string to lowercase letters.
|
||||
*
|
||||
* @param str String to convert string.
|
||||
* @param input The string to convert.
|
||||
* @param output The string to be converted.
|
||||
*/
|
||||
inline std::string ToLower(const std::string& str)
|
||||
inline void ToLower(const std::string& input, std::string& output)
|
||||
{
|
||||
std::string out = str;
|
||||
|
||||
std::transform(str.begin(), str.end(), out.begin(),
|
||||
std::transform(input.begin(), input.end(), output.begin(),
|
||||
[](unsigned char c){ return std::tolower(c); });
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
|
||||
@@ -126,7 +126,8 @@ AtrousConvolution<
|
||||
1);
|
||||
|
||||
// Transform paddingType to lowercase.
|
||||
std::string paddingTypeLow = util::ToLower(paddingType);
|
||||
std::string paddingTypeLow = paddingType;
|
||||
util::ToLower(paddingType, paddingTypeLow);
|
||||
|
||||
size_t padWLeft = std::get<0>(padW);
|
||||
size_t padWRight = std::get<1>(padW);
|
||||
|
||||
@@ -121,7 +121,8 @@ Convolution<
|
||||
1);
|
||||
|
||||
// Transform paddingType to lowercase.
|
||||
std::string paddingTypeLow = util::ToLower(paddingType);
|
||||
std::string paddingTypeLow = paddingType;
|
||||
util::ToLower(paddingType, paddingTypeLow);
|
||||
|
||||
if (paddingTypeLow == "valid")
|
||||
{
|
||||
|
||||
@@ -127,7 +127,8 @@ TransposedConvolution<
|
||||
weights.set_size((outSize * inSize * kernelWidth * kernelHeight) + outSize,
|
||||
1);
|
||||
// Transform paddingType to lowercase.
|
||||
std::string paddingTypeLow = util::ToLower(paddingType);
|
||||
std::string paddingTypeLow = paddingType;
|
||||
util::ToLower(paddingType, paddingTypeLow);
|
||||
|
||||
if (paddingTypeLow == "valid")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user