mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
15 lines
328 B
C++
15 lines
328 B
C++
#include "caffe2/utils/string_utils.h"
|
|
|
|
namespace caffe2 {
|
|
|
|
std::vector<std::string> split(char separator, const std::string& string) {
|
|
std::vector<std::string> pieces;
|
|
std::stringstream ss(string);
|
|
std::string item;
|
|
while (getline(ss, item, separator)) {
|
|
pieces.push_back(std::move(item));
|
|
}
|
|
return pieces;
|
|
}
|
|
}
|