Add missing declarations for explicit instantiations.
The current behaviour (using externally defined instantiations without having seen a declaration of those external instantiations) is undesirable and effectively deprecated, and is warned about by -Wundefined-func-template. PiperOrigin-RevId: 252940775
This commit is contained in:
parent
30b29861dc
commit
da251b3c48
@ -1335,6 +1335,17 @@ class OpKernelContext {
|
|||||||
TF_DISALLOW_COPY_AND_ASSIGN(OpKernelContext);
|
TF_DISALLOW_COPY_AND_ASSIGN(OpKernelContext);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
const Eigen::ThreadPoolDevice& OpKernelContext::eigen_device() const;
|
||||||
|
|
||||||
|
template <>
|
||||||
|
const Eigen::GpuDevice& OpKernelContext::eigen_device() const;
|
||||||
|
|
||||||
|
#ifdef TENSORFLOW_USE_SYCL
|
||||||
|
template <>
|
||||||
|
const Eigen::SyclDevice& OpKernelContext::eigen_device() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Register your OpKernel by specifying the Op's name, the device the
|
// Register your OpKernel by specifying the Op's name, the device the
|
||||||
// kernel runs on, any type attr constraints for this kernel, any
|
// kernel runs on, any type attr constraints for this kernel, any
|
||||||
// host-memory args, and the class to instantiate. Examples:
|
// host-memory args, and the class to instantiate. Examples:
|
||||||
|
@ -104,6 +104,30 @@ class Spectrogram {
|
|||||||
std::vector<double> fft_double_working_area_;
|
std::vector<double> fft_double_working_area_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Explicit instantiations in spectrogram.cc.
|
||||||
|
|
||||||
|
extern template bool Spectrogram::ComputeComplexSpectrogram(
|
||||||
|
const std::vector<float>& input,
|
||||||
|
std::vector<std::vector<std::complex<float>>>*);
|
||||||
|
extern template bool Spectrogram::ComputeComplexSpectrogram(
|
||||||
|
const std::vector<double>& input,
|
||||||
|
std::vector<std::vector<std::complex<float>>>*);
|
||||||
|
extern template bool Spectrogram::ComputeComplexSpectrogram(
|
||||||
|
const std::vector<float>& input,
|
||||||
|
std::vector<std::vector<std::complex<double>>>*);
|
||||||
|
extern template bool Spectrogram::ComputeComplexSpectrogram(
|
||||||
|
const std::vector<double>& input,
|
||||||
|
std::vector<std::vector<std::complex<double>>>*);
|
||||||
|
|
||||||
|
extern template bool Spectrogram::ComputeSquaredMagnitudeSpectrogram(
|
||||||
|
const std::vector<float>& input, std::vector<std::vector<float>>*);
|
||||||
|
extern template bool Spectrogram::ComputeSquaredMagnitudeSpectrogram(
|
||||||
|
const std::vector<double>& input, std::vector<std::vector<float>>*);
|
||||||
|
extern template bool Spectrogram::ComputeSquaredMagnitudeSpectrogram(
|
||||||
|
const std::vector<float>& input, std::vector<std::vector<double>>*);
|
||||||
|
extern template bool Spectrogram::ComputeSquaredMagnitudeSpectrogram(
|
||||||
|
const std::vector<double>& input, std::vector<std::vector<double>>*);
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace tflite
|
} // namespace tflite
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user