MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Conv2DWithBias

Function Conv2DWithBias

tensorflow/core/kernels/conv_ops_benchmark_test.cc:107–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105// Creates a Tensorflow graph with a Conv2D node followed by BiasAdd.
106template <typename T>
107static Conv2DWithBiasGraph Conv2DWithBias(
108 int batch, int height, int width, int in_depth, int filter_w, int filter_h,
109 int out_depth, TensorFormat data_format = FORMAT_NHWC) {
110 Conv2DGraph conv_graph = Conv2D<T>(batch, height, width, in_depth, filter_w,
111 filter_h, out_depth, data_format);
112
113 Graph* graph = conv_graph.graph;
114 Node* conv2d = conv_graph.conv2d;
115
116 Tensor bias_t = MakeRandomTensor<T>({out_depth});
117 Node* bias = test::graph::Constant(graph, bias_t, "bias");
118
119 Node* out;
120 TF_CHECK_OK(NodeBuilder(graph->NewName("bias"), "BiasAdd")
121 .Input(conv2d)
122 .Input(bias)
123 .Attr("T", DataTypeToEnum<T>::value)
124 .Attr("data_format", ToString(data_format))
125 .Finalize(graph, &out));
126
127 return {graph, conv2d, out};
128}
129
130// Creates a Tensorflow graph with a Conv2D node followed by BiasAdd and
131// activation (Relu, Relu6, etc...).

Callers

nothing calls this directly

Calls 7

ConstantFunction · 0.70
ToStringFunction · 0.70
NodeBuilderClass · 0.50
FinalizeMethod · 0.45
AttrMethod · 0.45
InputMethod · 0.45
NewNameMethod · 0.45

Tested by

no test coverage detected