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

Function BiasAddGrad

tensorflow/core/kernels/cwise_ops_test.cc:258–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256
257template <class T>
258Graph* BiasAddGrad(int rows, int cols, int channels, DataType type,
259 TensorFormat format) {
260 Graph* g = new Graph(OpRegistry::Global());
261 TensorShape lhs_shape;
262 if (format == FORMAT_NCHW) {
263 lhs_shape = TensorShape({channels, rows, cols});
264 } else {
265 lhs_shape = TensorShape({rows, cols, channels});
266 }
267 Tensor lhs(type, lhs_shape);
268 lhs.template flat<T>().setRandom();
269 Node* n;
270 TF_CHECK_OK(NodeBuilder(g->NewName("n"), "BiasAddGrad")
271 .Attr("data_format", ToString(format))
272 .Input(test::graph::Constant(g, lhs), /*src_index=*/0)
273 .Finalize(g, &n));
274 return g;
275}
276
277#define BM_BIAS_ADD_GRAD(DEVICE, FMT, C_TYPE, TF_TYPE, R, C, CH) \
278 void BM_##DEVICE##_##FMT##_##C_TYPE##_BiasAddGrad_R##R##_C##C##_CH##CH( \

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected