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

Function TEST

tensorflow/core/ops/array_grad_test.cc:63–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63TEST(ArrayGradTest, PackGrad) {
64 Tensor x0(DT_FLOAT, {2, 3});
65 x0.flat<float>().setZero();
66 Tensor x1(DT_FLOAT, {2, 3});
67 x1.flat<float>().setZero();
68 Tensor dy(DT_FLOAT, {2, 2, 3});
69 test::FillIota<float>(&dy, 0);
70 auto dx = PackGrad(x0, x1, dy, 0);
71 test::ExpectClose(dx[0],
72 test::AsTensor<float>({0., 1., 2., 3., 4., 5.}, {2, 3}));
73 test::ExpectClose(dx[1],
74 test::AsTensor<float>({6., 7., 8., 9., 10., 11.}, {2, 3}));
75}
76
77std::vector<Tensor> UnpackGrad(const Tensor& x, const Tensor& dy0,
78 const Tensor& dy1, int axis) {

Callers

nothing calls this directly

Calls 15

ExpectCloseFunction · 0.85
PackGradFunction · 0.70
UnpackGradFunction · 0.70
ConcatGradFunction · 0.70
ConcatGradV2Function · 0.70
SplitGradFunction · 0.70
SplitVGradFunction · 0.70
ReshapeGradFunction · 0.70
ExpandDimsGradFunction · 0.70
SqueezeGradFunction · 0.70
TransposeGradFunction · 0.70
ReverseGradFunction · 0.70

Tested by

no test coverage detected