change \n's to less distracting spaces in hard-coded proto strings
authorJeff Donahue <jeff.donahue@gmail.com>
Sat, 15 Feb 2014 23:56:15 +0000 (15:56 -0800)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Wed, 26 Feb 2014 22:41:27 +0000 (14:41 -0800)
src/caffe/test/test_split_layer.cpp

index 19df34f..5d5a184 100644 (file)
@@ -133,276 +133,276 @@ TYPED_TEST_CASE(SplitLayerInsertionTest, InsertionDtypes);
 
 TYPED_TEST(SplitLayerInsertionTest, TestNoInsertion1) {
   const string& input_proto =
-      "name: \"TestNetwork\"\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"data\"\n"
-      "    type: \"data\"\n"
-      "  }\n"
-      "  top: \"data\"\n"
-      "  top: \"label\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data\"\n"
-      "  top: \"innerprod\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"loss\"\n"
-      "    type: \"softmax_with_loss\"\n"
-      "  }\n"
-      "  bottom: \"innerprod\"\n"
-      "  bottom: \"label\"\n"
-      "}\n";
+      "name: \"TestNetwork\" "
+      "layers: { "
+      "  layer { "
+      "    name: \"data\" "
+      "    type: \"data\" "
+      "  } "
+      "  top: \"data\" "
+      "  top: \"label\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data\" "
+      "  top: \"innerprod\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"loss\" "
+      "    type: \"softmax_with_loss\" "
+      "  } "
+      "  bottom: \"innerprod\" "
+      "  bottom: \"label\" "
+      "} ";
   this->RunInsertionTest(input_proto, input_proto);
 }
 
 TYPED_TEST(SplitLayerInsertionTest, TestNoInsertion2) {
   const string& input_proto =
-      "name: \"TestNetwork\"\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"data\"\n"
-      "    type: \"data\"\n"
-      "  }\n"
-      "  top: \"data\"\n"
-      "  top: \"label\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"data_split\"\n"
-      "    type: \"split\"\n"
-      "  }\n"
-      "  bottom: \"data\"\n"
-      "  top: \"data_split_0\"\n"
-      "  top: \"data_split_1\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod1\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data_split_0\"\n"
-      "  top: \"innerprod1\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod2\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data_split_1\"\n"
-      "  top: \"innerprod2\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"loss\"\n"
-      "    type: \"euclidean_loss\"\n"
-      "  }\n"
-      "  bottom: \"innerprod1\"\n"
-      "  bottom: \"innerprod2\"\n"
-      "}\n";
+      "name: \"TestNetwork\" "
+      "layers: { "
+      "  layer { "
+      "    name: \"data\" "
+      "    type: \"data\" "
+      "  } "
+      "  top: \"data\" "
+      "  top: \"label\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"data_split\" "
+      "    type: \"split\" "
+      "  } "
+      "  bottom: \"data\" "
+      "  top: \"data_split_0\" "
+      "  top: \"data_split_1\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod1\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data_split_0\" "
+      "  top: \"innerprod1\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod2\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data_split_1\" "
+      "  top: \"innerprod2\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"loss\" "
+      "    type: \"euclidean_loss\" "
+      "  } "
+      "  bottom: \"innerprod1\" "
+      "  bottom: \"innerprod2\" "
+      "} ";
   this->RunInsertionTest(input_proto, input_proto);
 }
 
 TYPED_TEST(SplitLayerInsertionTest, TestInsertion) {
   const string& input_proto =
-      "name: \"TestNetwork\"\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"data\"\n"
-      "    type: \"data\"\n"
-      "  }\n"
-      "  top: \"data\"\n"
-      "  top: \"label\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod1\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data\"\n"
-      "  top: \"innerprod1\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod2\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data\"\n"
-      "  top: \"innerprod2\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod3\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data\"\n"
-      "  top: \"innerprod3\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"loss\"\n"
-      "    type: \"euclidean_loss\"\n"
-      "  }\n"
-      "  bottom: \"innerprod1\"\n"
-      "  bottom: \"innerprod2\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"loss\"\n"
-      "    type: \"euclidean_loss\"\n"
-      "  }\n"
-      "  bottom: \"innerprod2\"\n"
-      "  bottom: \"innerprod3\"\n"
-      "}\n";
+      "name: \"TestNetwork\" "
+      "layers: { "
+      "  layer { "
+      "    name: \"data\" "
+      "    type: \"data\" "
+      "  } "
+      "  top: \"data\" "
+      "  top: \"label\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod1\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data\" "
+      "  top: \"innerprod1\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod2\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data\" "
+      "  top: \"innerprod2\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod3\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data\" "
+      "  top: \"innerprod3\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"loss\" "
+      "    type: \"euclidean_loss\" "
+      "  } "
+      "  bottom: \"innerprod1\" "
+      "  bottom: \"innerprod2\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"loss\" "
+      "    type: \"euclidean_loss\" "
+      "  } "
+      "  bottom: \"innerprod2\" "
+      "  bottom: \"innerprod3\" "
+      "} ";
   const string& expected_output_proto =
-      "name: \"TestNetwork\"\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"data\"\n"
-      "    type: \"data\"\n"
-      "  }\n"
-      "  top: \"data\"\n"
-      "  top: \"label\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"data_split\"\n"
-      "    type: \"split\"\n"
-      "  }\n"
-      "  bottom: \"data\"\n"
-      "  top: \"data_split_0\"\n"
-      "  top: \"data_split_1\"\n"
-      "  top: \"data_split_2\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod1\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data_split_0\"\n"
-      "  top: \"innerprod1\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod2\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data_split_1\"\n"
-      "  top: \"innerprod2\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod2_split\"\n"
-      "    type: \"split\"\n"
-      "  }\n"
-      "  bottom: \"innerprod2\"\n"
-      "  top: \"innerprod2_split_0\"\n"
-      "  top: \"innerprod2_split_1\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod3\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data_split_2\"\n"
-      "  top: \"innerprod3\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"loss\"\n"
-      "    type: \"euclidean_loss\"\n"
-      "  }\n"
-      "  bottom: \"innerprod1\"\n"
-      "  bottom: \"innerprod2_split_0\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"loss\"\n"
-      "    type: \"euclidean_loss\"\n"
-      "  }\n"
-      "  bottom: \"innerprod2_split_1\"\n"
-      "  bottom: \"innerprod3\"\n"
-      "}\n";
+      "name: \"TestNetwork\" "
+      "layers: { "
+      "  layer { "
+      "    name: \"data\" "
+      "    type: \"data\" "
+      "  } "
+      "  top: \"data\" "
+      "  top: \"label\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"data_split\" "
+      "    type: \"split\" "
+      "  } "
+      "  bottom: \"data\" "
+      "  top: \"data_split_0\" "
+      "  top: \"data_split_1\" "
+      "  top: \"data_split_2\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod1\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data_split_0\" "
+      "  top: \"innerprod1\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod2\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data_split_1\" "
+      "  top: \"innerprod2\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod2_split\" "
+      "    type: \"split\" "
+      "  } "
+      "  bottom: \"innerprod2\" "
+      "  top: \"innerprod2_split_0\" "
+      "  top: \"innerprod2_split_1\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod3\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data_split_2\" "
+      "  top: \"innerprod3\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"loss\" "
+      "    type: \"euclidean_loss\" "
+      "  } "
+      "  bottom: \"innerprod1\" "
+      "  bottom: \"innerprod2_split_0\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"loss\" "
+      "    type: \"euclidean_loss\" "
+      "  } "
+      "  bottom: \"innerprod2_split_1\" "
+      "  bottom: \"innerprod3\" "
+      "} ";
   this->RunInsertionTest(input_proto, expected_output_proto);
 }
 
 TYPED_TEST(SplitLayerInsertionTest, TestInputInsertion) {
   const string& input_proto =
-      "name: \"TestNetwork\"\n"
-      "input: \"data\"\n"
-      "input_dim: 10\n"
-      "input_dim: 3\n"
-      "input_dim: 227\n"
-      "input_dim: 227\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod1\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data\"\n"
-      "  top: \"innerprod1\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod2\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data\"\n"
-      "  top: \"innerprod2\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"loss\"\n"
-      "    type: \"euclidean_loss\"\n"
-      "  }\n"
-      "  bottom: \"innerprod1\"\n"
-      "  bottom: \"innerprod2\"\n"
-      "}\n";
+      "name: \"TestNetwork\" "
+      "input: \"data\" "
+      "input_dim: 10 "
+      "input_dim: 3 "
+      "input_dim: 227 "
+      "input_dim: 227 "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod1\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data\" "
+      "  top: \"innerprod1\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod2\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data\" "
+      "  top: \"innerprod2\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"loss\" "
+      "    type: \"euclidean_loss\" "
+      "  } "
+      "  bottom: \"innerprod1\" "
+      "  bottom: \"innerprod2\" "
+      "} ";
   const string& expected_output_proto =
-      "name: \"TestNetwork\"\n"
-      "input: \"data\"\n"
-      "input_dim: 10\n"
-      "input_dim: 3\n"
-      "input_dim: 227\n"
-      "input_dim: 227\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"data_split\"\n"
-      "    type: \"split\"\n"
-      "  }\n"
-      "  bottom: \"data\"\n"
-      "  top: \"data_split_0\"\n"
-      "  top: \"data_split_1\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod1\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data_split_0\"\n"
-      "  top: \"innerprod1\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"innerprod2\"\n"
-      "    type: \"inner_product\"\n"
-      "  }\n"
-      "  bottom: \"data_split_1\"\n"
-      "  top: \"innerprod2\"\n"
-      "}\n"
-      "layers: {\n"
-      "  layer {\n"
-      "    name: \"loss\"\n"
-      "    type: \"euclidean_loss\"\n"
-      "  }\n"
-      "  bottom: \"innerprod1\"\n"
-      "  bottom: \"innerprod2\"\n"
-      "}\n";
+      "name: \"TestNetwork\" "
+      "input: \"data\" "
+      "input_dim: 10 "
+      "input_dim: 3 "
+      "input_dim: 227 "
+      "input_dim: 227 "
+      "layers: { "
+      "  layer { "
+      "    name: \"data_split\" "
+      "    type: \"split\" "
+      "  } "
+      "  bottom: \"data\" "
+      "  top: \"data_split_0\" "
+      "  top: \"data_split_1\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod1\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data_split_0\" "
+      "  top: \"innerprod1\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"innerprod2\" "
+      "    type: \"inner_product\" "
+      "  } "
+      "  bottom: \"data_split_1\" "
+      "  top: \"innerprod2\" "
+      "} "
+      "layers: { "
+      "  layer { "
+      "    name: \"loss\" "
+      "    type: \"euclidean_loss\" "
+      "  } "
+      "  bottom: \"innerprod1\" "
+      "  bottom: \"innerprod2\" "
+      "} ";
   this->RunInsertionTest(input_proto, expected_output_proto);
 }