3 #include <caffe2/utils/proto_utils.h> 9 inline TensorProto_DataType GetCastDataType(
const ArgumentHelper& helper, std::string arg) {
10 TensorProto_DataType to;
11 if (helper.HasSingleArgumentOfType<
string>(arg)) {
12 string s = helper.GetSingleArgument<
string>(arg,
"float");
13 std::transform(s.begin(), s.end(), s.begin(), ::toupper);
14 #ifndef CAFFE2_USE_LITE_PROTO 15 CAFFE_ENFORCE(TensorProto_DataType_Parse(s, &to),
"Unknown 'to' argument: ", s);
21 return TensorProto_DataType_##t; \ 37 CAFFE_THROW(
"Unhandled type argument: ", s);
41 to =
static_cast<TensorProto_DataType
>(
42 helper.GetSingleArgument<
int>(arg, TensorProto_DataType_FLOAT));
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...