class_docstr: Kernel that just outputs positive constant values.
  
  Useful class for multiplying / adding constants with other kernels.
  
  Warning: This can potentially lead to poorly conditioned matrices, since
  if the constant is large, adding it to each entry of another matrix will
  make it closer to an ill-conditioned matrix. If using a `Constant` kernel
  as a summand for a composite kernel in a `GaussianProcess`, it's instead
  recommended to use a trainable mean instead.
class_docstr_tok: ["Kernel","that","just","outputs","positive","constant","values",".","Useful","class","for","multiplying","\/","adding","constants","with","other","kernels",".","Warning",":","This","can","potentially","lead","to","poorly","conditioned","matrices",",","since","if","the","constant","is","large",",","adding","it","to","each","entry","of","another","matrix","will","make","it","closer","to","an","ill-conditioned","matrix",".","If","using","a","`","Constant","`","kernel","as","a","summand","for","a","composite","kernel","in","a","`","GaussianProcess","`",",","it","'s","instead","recommended","to","use","a","trainable","mean","instead","."]
docstr: Construct a constant kernel instance.
  
  Args:
    constant: Positive floating point `Tensor` (or convertible) that is used
      for all kernel entries.
    feature_ndims: Python `int` number of rightmost dims to include in kernel
      computation.
    validate_args: If `True`, parameters are checked for validity despite
      possibly degrading runtime performance
    name: Python `str` name prefixed to Ops created by this class.
docstr_tok: ["Construct","a","constant","kernel","instance",".","Args",":","constant",":","Positive","floating","point","`","Tensor","`","(","or","convertible",")","that","is","used","for","all","kernel","entries",".","feature_ndims",":","Python","`","int","`","number","of","rightmost","dims","to","include","in","kernel","computation",".","validate_args",":","If","`","True","`",",","parameters","are","checked","for","validity","despite","possibly","degrading","runtime","performance","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class","."]
code: def __init__(
      self,
      constant,
      feature_ndims=1,
      validate_args=False,
      name="Constant",
  ):
      """Construct a constant kernel instance.
  
      Args:
        constant: Positive floating point `Tensor` (or convertible) that is used
          for all kernel entries.
        feature_ndims: Python `int` number of rightmost dims to include in kernel
          computation.
        validate_args: If `True`, parameters are checked for validity despite
          possibly degrading runtime performance
        name: Python `str` name prefixed to Ops created by this class.
      """
      parameters = dict(locals())
      with tf.name_scope(name):
          self._constant = tensor_util.convert_nonref_to_tensor(
              constant, name="constant"
          )
          from tensorflow_probability.python import (
              util as tfp_util,
          )  # pylint:disable=g-import-not-at-top
  
          super(Constant, self).__init__(
              bias_amplitude=tfp_util.DeferredTensor(
                  self._constant, tf.math.sqrt
              ),
              slope_amplitude=0.0,
              shift=None,
              feature_ndims=feature_ndims,
              validate_args=validate_args,
              parameters=parameters,
              name=name,
          )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math.psd_kernels import positive_semidefinite_kernel
  from tensorflow_probability.python.math.psd_kernels.internal import util
label_desc: Use image node_id 1 to create a new Constant object from inherited base classes: Linear with example: obj = Constant(constant, feature_ndims, validate_args, name)