2 // Copyright (c) 2018 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 #include "primitive_type_base.h"
19 #include "json_object.h"
23 primitive_type_id mvn_type_id()
25 static primitive_type_base<mvn> instance;
29 layout mvn_inst::calc_output_layout(mvn_node const& node)
31 assert((bool)node.get_primitive()->output_data_type == false
32 && "Output data type forcing is not supported for mvn_node!");
33 return node.input().get_non_padded_output_layout();
36 std::string mvn_inst::to_string(mvn_node const& node)
38 auto node_info = node.desc_to_json();
39 auto desc = node.get_primitive();
40 auto epsilon = desc->epsilon;
41 auto across_channels = desc->across_channels ? "true" : "false";
42 auto normalize_variance = desc->normalize_variance ? "true" : "false";
43 auto& input = node.input();
45 std::stringstream primitive_description;
47 json_composite mvn_info;
48 mvn_info.add("input id", input.id());
49 mvn_info.add("epsilon", epsilon);
50 mvn_info.add("across_channels region", across_channels);
51 mvn_info.add("normalize_variance region", normalize_variance);
53 node_info->add("mvn info", mvn_info);
54 node_info->dump(primitive_description);
56 return primitive_description.str();
59 mvn_inst::typed_primitive_inst(network_impl& network, mvn_node const& node)
60 :parent(network, node)