Infers the TFF type of the argument (a computation_types.Type
instance).
tff.types.infer_unplaced_type(
arg: Any
) -> Optional[tff.types.Type
]
The kinds of arguments that are currently correctly recognized:
- tensors, variables, and data sets
- things that are convertible to tensors (including
numpy
arrays, builtin
types, as well as list
s and tuple
s of any of the above, etc.)
- nested lists,
tuple
s, namedtuple
s, anonymous tuple
s, dict
,
OrderedDict
s, dataclasses
, attrs
classes, and tff.TypedObject
s
Args |
arg
|
The argument, the TFF type of which to infer.
|
Returns |
Either an instance of computation_types.Type , or None if the argument is
None .
|