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

Method Compute

tensorflow/contrib/ffmpeg/encode_audio_op.cc:172–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170 }
171
172 void Compute(OpKernelContext* context) override {
173 // Get and verify the input data.
174 OP_REQUIRES(
175 context, context->num_inputs() == 1,
176 errors::InvalidArgument("EncodeAudio requires exactly one input."));
177 const Tensor& contents = context->input(0);
178 OP_REQUIRES(context, TensorShapeUtils::IsMatrix(contents.shape()),
179 errors::InvalidArgument(
180 "sampled_audio must be a rank 2 tensor but got shape ",
181 contents.shape().DebugString()));
182 OP_REQUIRES(
183 context, contents.NumElements() <= std::numeric_limits<int32>::max(),
184 errors::InvalidArgument(
185 "sampled_audio cannot have more than 2^31 entries. Shape = ",
186 contents.shape().DebugString()));
187
188 Encode(context, contents, file_format_, bits_per_second_,
189 samples_per_second_);
190 }
191
192 private:
193 string file_format_;

Callers

nothing calls this directly

Calls 8

InvalidArgumentFunction · 0.85
EncodeFunction · 0.70
maxFunction · 0.50
num_inputsMethod · 0.45
inputMethod · 0.45
shapeMethod · 0.45
DebugStringMethod · 0.45
NumElementsMethod · 0.45

Tested by

no test coverage detected