Input is [...,N,N]. Outputs are: [...,N];[0], if compute_v is false, [...,N];[...,N,N], if compute_v is true.
| 88 | // [...,N];[0], if compute_v is false, |
| 89 | // [...,N];[...,N,N], if compute_v is true. |
| 90 | Status 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: |
nothing calls this directly
no test coverage detected