@@ -1035,13 +1035,13 @@ NetDef OnnxifiTransformer::SubnetToOnnxifiOpViaOnnx(
10351035bool OnnxifiTransformer::supportOpOnnx (
10361036 const caffe2::OperatorDef& op,
10371037 onnx::OnnxExporter* exporter,
1038- const std::unordered_set<int >& blacklisted_ops ,
1038+ const std::unordered_set<int >& blocklisted_ops ,
10391039 onnxBackendID backend_id) const {
10401040 try {
10411041 int pos =
10421042 ArgumentHelper::GetSingleArgument<OperatorDef, int >(op, kNetPos , -1 );
1043- if (blacklisted_ops .count (pos)) {
1044- LOG (INFO) << " Skipping blacklisted op " << op.type () << " at pos " << pos;
1043+ if (blocklisted_ops .count (pos)) {
1044+ LOG (INFO) << " Skipping blocklisted op " << op.type () << " at pos " << pos;
10451045 return false ;
10461046 }
10471047 const OpSchema* schema = OpSchemaRegistry::Schema (op.type ());
@@ -1136,13 +1136,13 @@ bool OnnxifiTransformer::supportOpC2(
11361136 const caffe2::OperatorDef& op,
11371137 const ShapeInfoMap& shape_hints,
11381138 const std::unordered_set<std::string>& weights,
1139- const std::unordered_set<int >& blacklisted_ops ,
1139+ const std::unordered_set<int >& blocklisted_ops ,
11401140 onnxBackendID backend_id) const {
11411141 try {
11421142 int pos =
11431143 ArgumentHelper::GetSingleArgument<OperatorDef, int >(op, kNetPos , -1 );
1144- if (blacklisted_ops .count (pos)) {
1145- LOG (INFO) << " Skipping blacklisted op " << op.type () << " at pos " << pos;
1144+ if (blocklisted_ops .count (pos)) {
1145+ LOG (INFO) << " Skipping blocklisted op " << op.type () << " at pos " << pos;
11461146 return false ;
11471147 }
11481148
@@ -1248,7 +1248,7 @@ void OnnxifiTransformer::tieGatherAndSparseLengthsWeightedSumOps(
12481248 const NetDef& net,
12491249 const ShapeInfoMap& shape_hints,
12501250 const std::unordered_set<std::string>& weights,
1251- std::unordered_set<int >* blacklisted_ops ) const {
1251+ std::unordered_set<int >* blocklisted_ops ) const {
12521252 std::unordered_map<std::string, int > output_pos;
12531253 onnx::OnnxExporter exporter (nullptr );
12541254 onnxBackendID backend_id = backend_ids_[idx_];
@@ -1263,8 +1263,8 @@ void OnnxifiTransformer::tieGatherAndSparseLengthsWeightedSumOps(
12631263 }
12641264 } else if (StartsWith (op.type (), " SparseLengthsWeighted" )) {
12651265 auto supported = opts_.use_onnx
1266- ? supportOpOnnx (op, &exporter, *blacklisted_ops , backend_id)
1267- : supportOpC2 (op, shape_hints, weights, *blacklisted_ops , backend_id);
1266+ ? supportOpOnnx (op, &exporter, *blocklisted_ops , backend_id)
1267+ : supportOpC2 (op, shape_hints, weights, *blocklisted_ops , backend_id);
12681268 if (!supported && op.input_size () > 1 ) {
12691269 check = op.input (1 );
12701270 }
@@ -1277,18 +1277,18 @@ void OnnxifiTransformer::tieGatherAndSparseLengthsWeightedSumOps(
12771277 if (it == output_pos.end ()) {
12781278 continue ;
12791279 }
1280- blacklisted_ops ->emplace (it->second );
1280+ blocklisted_ops ->emplace (it->second );
12811281 // We know that current op is not going to be supported. Might as well
1282- // blacklist it too
1283- blacklisted_ops ->emplace (
1282+ // blocklist it too
1283+ blocklisted_ops ->emplace (
12841284 ArgumentHelper::GetSingleArgument<OperatorDef, int >(op, kNetPos , -1 ));
12851285 }
12861286 }
12871287}
12881288
1289- void OnnxifiTransformer::blacklistCpuPartition (
1289+ void OnnxifiTransformer::blocklistCpuPartition (
12901290 const NetDef& net,
1291- std::unordered_set<int >* blacklisted_ops ) const {
1291+ std::unordered_set<int >* blocklisted_ops ) const {
12921292 std::unordered_set<std::string> cpu_partitions;
12931293 for (const auto & p : partition_infos_) {
12941294 if (p.device_id_size () == 0 ) {
@@ -1298,7 +1298,7 @@ void OnnxifiTransformer::blacklistCpuPartition(
12981298 for (const auto & op : net.op ()) {
12991299 const auto & pname = op.device_option ().node_name ();
13001300 if (cpu_partitions.count (pname)) {
1301- blacklisted_ops ->emplace (
1301+ blocklisted_ops ->emplace (
13021302 ArgumentHelper::GetSingleArgument<OperatorDef, int >(op, kNetPos , -1 ));
13031303 }
13041304 }
@@ -1308,10 +1308,10 @@ void OnnxifiTransformer::applyFilteringRules(
13081308 const NetDef& net,
13091309 const ShapeInfoMap& shape_hints,
13101310 const std::unordered_set<std::string>& weights,
1311- std::unordered_set<int >* blacklisted_ops ) const {
1311+ std::unordered_set<int >* blocklisted_ops ) const {
13121312 tieGatherAndSparseLengthsWeightedSumOps (
1313- net, shape_hints, weights, blacklisted_ops );
1314- blacklistCpuPartition (net, blacklisted_ops );
1313+ net, shape_hints, weights, blocklisted_ops );
1314+ blocklistCpuPartition (net, blocklisted_ops );
13151315}
13161316
13171317void OnnxifiTransformer::getBackendId () {
@@ -1338,16 +1338,16 @@ void OnnxifiTransformer::getBackendId() {
13381338NetDef OnnxifiTransformer::TransformViaC2 (
13391339 NetDef* pred_net,
13401340 const std::unordered_set<std::string>& weights,
1341- const std::unordered_set<int >& blacklisted_ops ,
1341+ const std::unordered_set<int >& blocklisted_ops ,
13421342 const ShapeInfoMap& shape_hints) {
13431343 onnxBackendID backend_id = backend_ids_[idx_];
13441344
13451345 auto c2_supports = [this ,
13461346 &shape_hints,
1347- &blacklisted_ops ,
1347+ &blocklisted_ops ,
13481348 backend_id,
13491349 &weights](const caffe2::OperatorDef& op) {
1350- return supportOpC2 (op, shape_hints, weights, blacklisted_ops , backend_id);
1350+ return supportOpC2 (op, shape_hints, weights, blocklisted_ops , backend_id);
13511351 };
13521352
13531353 auto c2_converter =
@@ -1363,15 +1363,15 @@ NetDef OnnxifiTransformer::TransformViaOnnx(
13631363 Workspace* ws,
13641364 NetDef* pred_net,
13651365 const std::unordered_set<std::string>& weights,
1366- const std::unordered_set<int >& blacklisted_ops ,
1366+ const std::unordered_set<int >& blocklisted_ops ,
13671367 ShapeInfoMap* shape_hints) {
13681368 onnxBackendID backend_id = backend_ids_[idx_];
13691369
13701370 // function to tell whether the ONNXIFI backend supports a given C2 op or not
13711371 onnx::OnnxExporter exporter (nullptr );
1372- auto onnx_supports = [this , &exporter, &blacklisted_ops , backend_id](
1372+ auto onnx_supports = [this , &exporter, &blocklisted_ops , backend_id](
13731373 const caffe2::OperatorDef& op) {
1374- return supportOpOnnx (op, &exporter, blacklisted_ops , backend_id);
1374+ return supportOpOnnx (op, &exporter, blocklisted_ops , backend_id);
13751375 };
13761376
13771377 // function to convert runnable subgraph into an onnxifi op. We need to keep
@@ -1401,7 +1401,7 @@ void OnnxifiTransformer::transform(
14011401 NetDef* pred_net,
14021402 const std::vector<std::string>& weight_names,
14031403 const ShapeInfoMap& input_shape_hints,
1404- const std::unordered_set<int >& blacklisted_ops ) {
1404+ const std::unordered_set<int >& blocklisted_ops ) {
14051405 CAFFE_ENFORCE (ws);
14061406 CAFFE_ENFORCE (pred_net, " Predict net cannot be nullptr" );
14071407
@@ -1462,15 +1462,15 @@ void OnnxifiTransformer::transform(
14621462 getBackendId ();
14631463
14641464 // Apply some filtering rules
1465- std::unordered_set<int > new_blacklisted_ops (
1466- blacklisted_ops .begin (), blacklisted_ops .end ());
1467- applyFilteringRules (*pred_net, shape_hints, weights, &new_blacklisted_ops );
1465+ std::unordered_set<int > new_blocklisted_ops (
1466+ blocklisted_ops .begin (), blocklisted_ops .end ());
1467+ applyFilteringRules (*pred_net, shape_hints, weights, &new_blocklisted_ops );
14681468
14691469 // Transform the net
14701470 NetDef net_opt = opts_.use_onnx
14711471 ? TransformViaOnnx (
1472- ws, pred_net, weights, new_blacklisted_ops , &shape_hints)
1473- : TransformViaC2 (pred_net, weights, new_blacklisted_ops , shape_hints);
1472+ ws, pred_net, weights, new_blocklisted_ops , &shape_hints)
1473+ : TransformViaC2 (pred_net, weights, new_blocklisted_ops , shape_hints);
14741474
14751475 // Need to figure out a proper place to handle device option
14761476 net_opt.mutable_device_option ()->CopyFrom (pred_net->device_option ());
0 commit comments