TensorFlow 2.0 RC is available Learn more

tft.apply_buckets

tft.apply_buckets(
    x,
    bucket_boundaries,
    name=None
)

Returns a bucketized column, with a bucket index assigned to each input.

Args:

  • x: A numeric input Tensor or SparseTensor whose values should be mapped to buckets. For SparseTensors, the non-missing values will be mapped to buckets and missing value left missing.
  • bucket_boundaries: The bucket boundaries represented as a rank 2 Tensor.
  • name: (Optional) A name for this operation.

Returns:

A Tensor of the same shape as x, with each element in the returned tensor representing the bucketized value. Bucketized value is in the range [0, len(bucket_boundaries)].