class_docstr: Splits the FunctionDef message type.
class_docstr_tok: ["Splits","the","FunctionDef","message","type","."]
docstr: Splits the proto, and returns the size of the chunks created.
docstr_tok: ["Splits","the","proto",",","and","returns","the","size","of","the","chunks","created","."]
code: def build_chunks(self) -> int:
      """Splits the proto, and returns the size of the chunks created."""
      size_diff = 0
  
      # First check if the entire FunctionDef can be split into a separate chunk.
      # We do this before the `RepeatedMessageSplitter`, which is costly because
      # it iterates through every `node_def`.
      if _GREEDY_SPLIT(self.proto_size) and not _ABOVE_MAX_SIZE(
          self.proto_size
      ):
          size_diff += LargeMessageSplitter(
              self._proto,
              self.proto_size,
              parent_splitter=self,
              fields_in_parent=[],
          ).build_chunks()
  
      if _ABOVE_MAX_SIZE(self.proto_size):
          # Split FunctionDefLibrary.function.node_def
          size_diff += RepeatedMessageSplitter(
              self._proto,
              "node_def",
              [ConstantNodeDefSplitter, LargeMessageSplitter],
              parent_splitter=self,
              fields_in_parent=[],
          ).build_chunks()
      return size_diff
  
imports: from collections.abc import Sequence
  import itertools
  from typing import Optional, Type
  from google.protobuf import message
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.framework import node_def_pb2
  from tensorflow.python.framework import tensor_util
  from tensorflow.tools.proto_splitter import constants
  from tensorflow.tools.proto_splitter import split
  from tensorflow.tools.proto_splitter import util
label_desc: Use image node_id 1 for calling the FunctionDefSplitter obj's underlying member method code with example usage: obj.build_chunks() and returns: size_diff