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

Function LuShapeFn

tensorflow/core/ops/linalg_ops.cc:115–134  ·  view source on GitHub ↗

Input is [...,N,N]. First and second outputs are: [...,N,N]; [...,N].

Source from the content-addressed store, hash-verified

113// First and second outputs are:
114// [...,N,N]; [...,N].
115Status LuShapeFn(InferenceContext* c) {
116 ShapeHandle input;
117 TF_RETURN_IF_ERROR(c->WithRankAtLeast(c->input(0), 2, &input));
118
119 DimensionHandle n;
120 TF_RETURN_IF_ERROR(c->Merge(c->Dim(input, -2), c->Dim(input, -1), &n));
121
122 ShapeHandle batch_shape;
123 TF_RETURN_IF_ERROR(c->Subshape(input, 0, -2, &batch_shape));
124
125 ShapeHandle lu_shape;
126 ShapeHandle p_shape;
127
128 TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Matrix(n, n), &lu_shape));
129 TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Vector(n), &p_shape));
130
131 c->set_output(0, lu_shape);
132 c->set_output(1, p_shape);
133 return Status::OK();
134}
135
136// Input is [...,M,N].
137// First and second outputs are:

Callers

nothing calls this directly

Calls 9

WithRankAtLeastMethod · 0.80
SubshapeMethod · 0.80
MatrixMethod · 0.80
VectorMethod · 0.80
inputMethod · 0.45
MergeMethod · 0.45
DimMethod · 0.45
ConcatenateMethod · 0.45
set_outputMethod · 0.45

Tested by

no test coverage detected