Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tff.framework.serialize_type

View source on GitHub

Serializes 'type_spec' as a pb.Type.

tff.framework.serialize_type(
    type_spec
)

Args:

  • type_spec: Either an instance of computation_types.Type, or something convertible to it by computation_types.to_type(), or None.

Returns:

The corresponding instance of pb.Type, or None if the argument was None.

Raises:

  • TypeError: if the argument is of the wrong type.
  • NotImplementedError: for type variants for which serialization is not implemented.