Skip to content

Utils

tfx.v1.utils

TFX utils module.

FUNCTION DESCRIPTION
parse_pbtxt_file

Parses a protobuf message from a text file and return message itself.

ATTRIBUTE DESCRIPTION
JsonableType

Attributes

JsonableType module-attribute

JsonableType = JsonableValue

Functions

parse_pbtxt_file

parse_pbtxt_file(file_name: str, message: ProtoMessage) -> ProtoMessage

Parses a protobuf message from a text file and return message itself.

Source code in tfx/utils/io_utils.py
def parse_pbtxt_file(file_name: str, message: ProtoMessage) -> ProtoMessage:
  """Parses a protobuf message from a text file and return message itself."""
  contents = fileio.open(file_name).read()
  text_format.Parse(contents, message)
  return message