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

Method MatMulCommon

tensorflow/core/ops/math_grad_test.cc:251–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249 }
250
251 Tensor MatMulCommon(const string& opname, const string& attr_adj_x,
252 const string& attr_adj_y, const Tensor& x, bool ax,
253 const Tensor& y, bool ay) {
254 auto T = x.dtype();
255 auto gdef = test::function::GDef(
256 {
257 f::NDef("x", "Placeholder", {}, {{"dtype", T}}),
258 f::NDef("y", "Placeholder", {}, {{"dtype", T}}),
259 f::NDef("z", opname, {"x", "y"},
260 {{"T", T}, {attr_adj_x, ax}, {attr_adj_y, ay}}),
261 },
262 {});
263 auto sess = NewSession();
264 TF_CHECK_OK(sess->Create(gdef));
265 std::vector<Tensor> outputs;
266 TF_CHECK_OK(sess->Run({{"x:0", x}, {"y:0", y}}, {"z:0"}, {}, &outputs));
267 CHECK_EQ(outputs.size(), 1);
268 TF_CHECK_OK(sess->Close());
269 return outputs[0];
270 }
271
272 Tensor MatMul(const Tensor& x, bool ax, const Tensor& y, bool ay) {
273 return MatMulCommon("MatMul", "transpose_a", "transpose_b", x, ax, y, ay);

Callers

nothing calls this directly

Calls 8

GDefFunction · 0.85
NDefFunction · 0.85
NewSessionFunction · 0.70
dtypeMethod · 0.45
CreateMethod · 0.45
RunMethod · 0.45
sizeMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected