| 101 | } |
| 102 | |
| 103 | Status MfccShapeFn(InferenceContext* c) { |
| 104 | ShapeHandle spectrogram; |
| 105 | TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 3, &spectrogram)); |
| 106 | ShapeHandle unused; |
| 107 | TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused)); |
| 108 | |
| 109 | int32 dct_coefficient_count; |
| 110 | TF_RETURN_IF_ERROR( |
| 111 | c->GetAttr("dct_coefficient_count", &dct_coefficient_count)); |
| 112 | |
| 113 | DimensionHandle spectrogram_channels = c->Dim(spectrogram, 0); |
| 114 | DimensionHandle spectrogram_length = c->Dim(spectrogram, 1); |
| 115 | |
| 116 | DimensionHandle output_channels = c->MakeDim(dct_coefficient_count); |
| 117 | |
| 118 | c->set_output(0, c->MakeShape({spectrogram_channels, spectrogram_length, |
| 119 | output_channels})); |
| 120 | return Status::OK(); |
| 121 | } |
| 122 | |
| 123 | } // namespace |
| 124 | |