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

Function SelfAdjointEigV2ShapeFn

tensorflow/core/ops/linalg_ops.cc:90–110  ·  view source on GitHub ↗

Input is [...,N,N]. Outputs are: [...,N];[0], if compute_v is false, [...,N];[...,N,N], if compute_v is true.

Source from the content-addressed store, hash-verified

88// [...,N];[0], if compute_v is false,
89// [...,N];[...,N,N], if compute_v is true.
90Status SelfAdjointEigV2ShapeFn(InferenceContext* c) {
91 ShapeHandle input;
92 TF_RETURN_IF_ERROR(MakeBatchSquareMatrix(c, c->input(0), &input));
93 DimensionHandle n;
94 TF_RETURN_IF_ERROR(c->Merge(c->Dim(input, -2), c->Dim(input, -1), &n));
95 ShapeHandle batch_shape;
96 TF_RETURN_IF_ERROR(c->Subshape(input, 0, -2, &batch_shape));
97 ShapeHandle e_shape;
98 TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Vector(n), &e_shape));
99 c->set_output(0, e_shape);
100 bool compute_v;
101 TF_RETURN_IF_ERROR(c->GetAttr("compute_v", &compute_v));
102 if (compute_v) {
103 ShapeHandle v_shape;
104 TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Matrix(n, n), &v_shape));
105 c->set_output(1, v_shape);
106 } else {
107 c->set_output(1, c->Vector(0ll));
108 }
109 return Status::OK();
110}
111
112// Input is [...,N,N].
113// First and second outputs are:

Callers

nothing calls this directly

Calls 10

MakeBatchSquareMatrixFunction · 0.85
SubshapeMethod · 0.80
VectorMethod · 0.80
MatrixMethod · 0.80
inputMethod · 0.45
MergeMethod · 0.45
DimMethod · 0.45
ConcatenateMethod · 0.45
set_outputMethod · 0.45
GetAttrMethod · 0.45

Tested by

no test coverage detected