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

Function MakeBatchSquareMatrix

tensorflow/core/ops/linalg_ops.cc:29–41  ·  view source on GitHub ↗

Return in the result of making the end of a square matrix.

Source from the content-addressed store, hash-verified

27
28// Return in <out> the result of making the end of <s> a square matrix.
29Status MakeBatchSquareMatrix(InferenceContext* c, ShapeHandle input,
30 ShapeHandle* out) {
31 ShapeHandle s;
32 TF_RETURN_IF_ERROR(c->WithRankAtLeast(input, 2, &s));
33
34 DimensionHandle d;
35 TF_RETURN_IF_ERROR(c->Merge(c->Dim(s, -2), c->Dim(s, -1), &d));
36
37 ShapeHandle batch_shape;
38 TF_RETURN_IF_ERROR(c->Subshape(s, 0, -2, &batch_shape));
39 TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Matrix(d, d), out));
40 return Status::OK();
41}
42
43Status BatchUnchangedSquareShapeFn(InferenceContext* c) {
44 ShapeHandle out;

Callers 4

MatrixSolveShapeFnFunction · 0.85
SelfAdjointEigV2ShapeFnFunction · 0.85
linalg_ops.ccFile · 0.85

Calls 6

WithRankAtLeastMethod · 0.80
SubshapeMethod · 0.80
MatrixMethod · 0.80
MergeMethod · 0.45
DimMethod · 0.45
ConcatenateMethod · 0.45

Tested by

no test coverage detected