We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ef9bfcf + 06de824 commit 06ffbc4Copy full SHA for 06ffbc4
paddle/fluid/pybind/protobuf.cc
@@ -57,6 +57,18 @@ struct variant_caster<V<Ts...>> {
57
auto caster = make_caster<T>();
58
if (!load_success_ && caster.load(src, convert)) {
59
load_success_ = true;
60
+
61
+ if (std::is_same<T, std::vector<float>>::value) {
62
+ auto caster_ints = make_caster<std::vector<int64_t>>();
63
+ if (caster_ints.load(src, convert)) {
64
+ VLOG(4) << "This value are floats and int64_ts satisfy "
65
+ "simultaneously, will set it's type to "
66
+ "std::vector<int64_t>";
67
+ value = cast_op<std::vector<int64_t>>(caster_ints);
68
+ return true;
69
+ }
70
71
72
value = cast_op<T>(caster);
73
return true;
74
}
0 commit comments