code: def _annotate_buckets(
      x: tf.Tensor, bucket_boundaries: tf.Tensor
  ) -> None:
      """Annotates a bucketized tensor with the boundaries that were applied.
  
      Creates a deferred annotation for the specified tensor.
  
      Args:
        x: The tensor to annotate.
        bucket_boundaries: A tensor of boundaries that were used to bucketize x.
      """
      # The annotations proto currently isn't available in OSS builds, so schema
      # annotations are not supported.
      if not common.IS_ANNOTATIONS_PB_AVAILABLE:
          return
      from tensorflow_transform import (
          annotations_pb2,
      )  # pylint: disable=g-import-not-at-top
  
      message_type = (
          annotations_pb2.BucketBoundaries.DESCRIPTOR.full_name
      )
  
      # The BucketBoundaries annotation expects a float field.
      bucket_boundaries = tf.cast(bucket_boundaries, tf.float32)
      # Some callers provide rank 2 boundaries like [[.25], [.5], [.75], [1.]],
      # whereas we expect rank 2 boundaries like [[.25, .5, .75, 1.]]
      bucket_boundaries = tf.reshape(bucket_boundaries, [-1])
      bucket_boundaries = tf.expand_dims(bucket_boundaries, 0)
      size = (tf.shape(bucket_boundaries)[1],)
      message_proto = tf.raw_ops.EncodeProto(
          sizes=[size],
          values=[bucket_boundaries],
          field_names=["boundaries"],
          message_type=message_type,
      )
      assert message_proto.shape == [1]
      message_proto = message_proto[0]
  
      type_url = os.path.join(
          common.ANNOTATION_PREFIX_URL, message_type
      )
      schema_inference.annotate(type_url, message_proto, tensor=x)
  
imports: import os
  from typing import Any, Callable, Iterable, Optional, Tuple, Union
  import tensorflow
  from tensorflow_transform import analyzers
  from tensorflow_transform import common
  from tensorflow_transform import common_types
  from tensorflow_transform import gaussianization
  from tensorflow_transform import schema_inference
  from tensorflow_transform import tf_utils
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 37 for calling a global function with example usage: _annotate_buckets(x, bucket_boundaries) without return types