1// This file is MACHINE GENERATED! Do not edit.
2
3
4#include "tensorflow/cc/ops/const_op.h"
5#include "tensorflow/cc/ops/audio_ops.h"
6
7namespace tensorflow {
8namespace ops {
9
10AudioSpectrogram::AudioSpectrogram(const ::tensorflow::Scope& scope,
11 ::tensorflow::Input input, int64
12 window_size, int64 stride, const
13 AudioSpectrogram::Attrs& attrs) {
14 if (!scope.ok()) return;
15 auto _input = ::tensorflow::ops::AsNodeOut(scope, input);
16 if (!scope.ok()) return;
17 ::tensorflow::Node* ret;
18 const auto unique_name = scope.GetUniqueNameForOp("AudioSpectrogram");
19 auto builder = ::tensorflow::NodeBuilder(unique_name, "AudioSpectrogram")
20 .Input(_input)
21 .Attr("window_size", window_size)
22 .Attr("stride", stride)
23 .Attr("magnitude_squared", attrs.magnitude_squared_)
24 ;
25 scope.UpdateBuilder(&builder);
26 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
27 if (!scope.ok()) return;
28 scope.UpdateStatus(scope.DoShapeInference(ret));
29 this->operation = Operation(ret);
30 this->spectrogram = Output(ret, 0);
31}
32
33AudioSpectrogram::AudioSpectrogram(const ::tensorflow::Scope& scope,
34 ::tensorflow::Input input, int64
35 window_size, int64 stride)
36 : AudioSpectrogram(scope, input, window_size, stride, AudioSpectrogram::Attrs()) {}
37
38DecodeWav::DecodeWav(const ::tensorflow::Scope& scope, ::tensorflow::Input
39 contents, const DecodeWav::Attrs& attrs) {
40 if (!scope.ok()) return;
41 auto _contents = ::tensorflow::ops::AsNodeOut(scope, contents);
42 if (!scope.ok()) return;
43 ::tensorflow::Node* ret;
44 const auto unique_name = scope.GetUniqueNameForOp("DecodeWav");
45 auto builder = ::tensorflow::NodeBuilder(unique_name, "DecodeWav")
46 .Input(_contents)
47 .Attr("desired_channels", attrs.desired_channels_)
48 .Attr("desired_samples", attrs.desired_samples_)
49 ;
50 scope.UpdateBuilder(&builder);
51 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
52 if (!scope.ok()) return;
53 scope.UpdateStatus(scope.DoShapeInference(ret));
54 this->operation = Operation(ret);
55 ::tensorflow::NameRangeMap _outputs_range;
56 ::tensorflow::Status _status_ = ::tensorflow::NameRangesForNode(*ret, ret->op_def(), nullptr, &_outputs_range);
57 if (!_status_.ok()) {
58 scope.UpdateStatus(_status_);
59 return;
60 }
61
62 this->audio = Output(ret, _outputs_range["audio"].first);
63 this->sample_rate = Output(ret, _outputs_range["sample_rate"].first);
64}
65
66DecodeWav::DecodeWav(const ::tensorflow::Scope& scope, ::tensorflow::Input
67 contents)
68 : DecodeWav(scope, contents, DecodeWav::Attrs()) {}
69
70EncodeWav::EncodeWav(const ::tensorflow::Scope& scope, ::tensorflow::Input
71 audio, ::tensorflow::Input sample_rate) {
72 if (!scope.ok()) return;
73 auto _audio = ::tensorflow::ops::AsNodeOut(scope, audio);
74 if (!scope.ok()) return;
75 auto _sample_rate = ::tensorflow::ops::AsNodeOut(scope, sample_rate);
76 if (!scope.ok()) return;
77 ::tensorflow::Node* ret;
78 const auto unique_name = scope.GetUniqueNameForOp("EncodeWav");
79 auto builder = ::tensorflow::NodeBuilder(unique_name, "EncodeWav")
80 .Input(_audio)
81 .Input(_sample_rate)
82 ;
83 scope.UpdateBuilder(&builder);
84 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
85 if (!scope.ok()) return;
86 scope.UpdateStatus(scope.DoShapeInference(ret));
87 this->operation = Operation(ret);
88 this->contents = Output(ret, 0);
89}
90
91Mfcc::Mfcc(const ::tensorflow::Scope& scope, ::tensorflow::Input spectrogram,
92 ::tensorflow::Input sample_rate, const Mfcc::Attrs& attrs) {
93 if (!scope.ok()) return;
94 auto _spectrogram = ::tensorflow::ops::AsNodeOut(scope, spectrogram);
95 if (!scope.ok()) return;
96 auto _sample_rate = ::tensorflow::ops::AsNodeOut(scope, sample_rate);
97 if (!scope.ok()) return;
98 ::tensorflow::Node* ret;
99 const auto unique_name = scope.GetUniqueNameForOp("Mfcc");
100 auto builder = ::tensorflow::NodeBuilder(unique_name, "Mfcc")
101 .Input(_spectrogram)
102 .Input(_sample_rate)
103 .Attr("upper_frequency_limit", attrs.upper_frequency_limit_)
104 .Attr("lower_frequency_limit", attrs.lower_frequency_limit_)
105 .Attr("filterbank_channel_count", attrs.filterbank_channel_count_)
106 .Attr("dct_coefficient_count", attrs.dct_coefficient_count_)
107 ;
108 scope.UpdateBuilder(&builder);
109 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
110 if (!scope.ok()) return;
111 scope.UpdateStatus(scope.DoShapeInference(ret));
112 this->operation = Operation(ret);
113 this->output = Output(ret, 0);
114}
115
116Mfcc::Mfcc(const ::tensorflow::Scope& scope, ::tensorflow::Input spectrogram,
117 ::tensorflow::Input sample_rate)
118 : Mfcc(scope, spectrogram, sample_rate, Mfcc::Attrs()) {}
119
120/// @}
121
122} // namespace ops
123} // namespace tensorflow
124