tensorflow/core/kernels/image/scale_and_translate_op.cc
// Computes the spans for the passed kernel, for a input dimension of length
// input_size transformed by scale and translate to an output dimension of
// length output_size. Note that there's no requirement that;
// output_size = input_size * scale.
Computes the spans for the passed kernel, for a input dimension of length
input_size transformed by scale and translate to an output dimension of
length output_size. Note that there's no requirement that;
output_size = input_size * scale.
Computes the spans for the passed kernel for a input dimension of length input_size transformed by scale and translate to an output dimension of length output_size . Note that there ' s no requirement that ; output_size = input_size * scale .
Status ComputeSpans(OpKernelContext* context,
                    const functor::SamplingKernelType kernel_type,
                    const int64_t output_size, const int64_t input_size,
                    const float scale, const float translate,
                    const bool antialias, Spans* spans) {
  switch (kernel_type) {
    case functor::Lanczos1Kernel: {
      return ComputeSpansCore(context, CreateLanczos1Kernel(), output_size,
                              input_size, scale, translate, antialias, spans);
    }
    case functor::Lanczos3Kernel: {
      return ComputeSpansCore(context, CreateLanczos3Kernel(), output_size,
                              input_size, scale, translate, antialias, spans);
    }
    case functor::Lanczos5Kernel: {
      return ComputeSpansCore(context, CreateLanczos5Kernel(), output_size,
                              input_size, scale, translate, antialias, spans);
    }
    case functor::GaussianKernel: {
      return ComputeSpansCore(context, CreateGaussianKernel(), output_size,
                              input_size, scale, translate, antialias, spans);
    }
    case functor::BoxKernel: {
      return ComputeSpansCore(context, CreateBoxKernel(), output_size,
                              input_size, scale, translate, antialias, spans);
    }
    case functor::TriangleKernel: {
      return ComputeSpansCore(context, CreateTriangleKernel(), output_size,
                              input_size, scale, translate, antialias, spans);
    }
    case functor::KeysCubicKernel: {
      return ComputeSpansCore(context, CreateKeysCubicKernel(), output_size,
                              input_size, scale, translate, antialias, spans);
    }
    case functor::MitchellCubicKernel: {
      return ComputeSpansCore(context, CreateMitchellCubicKernel(), output_size,
                              input_size, scale, translate, antialias, spans);
    }
    default:
      return errors::InvalidArgument(Printf("Unrecognized kernel type: %d",
                                            static_cast<int>(kernel_type)));
  }
  return Status::OK();
}
Status ComputeSpans ( OpKernelContext * context , const functor :: SamplingKernelType kernel_type , const int64_t output_size , const int64_t input_size , const float scale , const float translate , const bool antialias , Spans * spans ) { switch ( kernel_type ) { case functor :: Lanczos1Kernel : { return ComputeSpansCore ( context , CreateLanczos1Kernel ( ) , output_size , input_size , scale , translate , antialias , spans ) ; } case functor :: Lanczos3Kernel : { return ComputeSpansCore ( context , CreateLanczos3Kernel ( ) , output_size , input_size , scale , translate , antialias , spans ) ; } case functor :: Lanczos5Kernel : { return ComputeSpansCore ( context , CreateLanczos5Kernel ( ) , output_size , input_size , scale , translate , antialias , spans ) ; } case functor :: GaussianKernel : { return ComputeSpansCore ( context , CreateGaussianKernel ( ) , output_size , input_size , scale , translate , antialias , spans ) ; } case functor :: BoxKernel : { return ComputeSpansCore ( context , CreateBoxKernel ( ) , output_size , input_size , scale , translate , antialias , spans ) ; } case functor :: TriangleKernel : { return ComputeSpansCore ( context , CreateTriangleKernel ( ) , output_size , input_size , scale , translate , antialias , spans ) ; } case functor :: KeysCubicKernel : { return ComputeSpansCore ( context , CreateKeysCubicKernel ( ) , output_size , input_size , scale , translate , antialias , spans ) ; } case functor :: MitchellCubicKernel : { return ComputeSpansCore ( context , CreateMitchellCubicKernel ( ) , output_size , input_size , scale , translate , antialias , spans ) ; } default : return errors :: InvalidArgument ( Printf ( " " , static_cast < int > ( kernel_type ) ) ) ; } return Status :: OK ( ) ; }
Computes the spans for the passed kernel, for a input dimension of length
input_size transformed by scale and translate to an output dimension of
length output_size.
Computes the spans for the passed kernel for a input dimension of length input_size transformed by scale and translate to an output dimension of length output_size .