Commit 89513c89 authored by Keith Rush's avatar Keith Rush Committed by tensorflow-copybara
Browse files

Extends documentation of TFF's TensorType to explicitly discuss tensor shapes and unknown ranks.

PiperOrigin-RevId: 411173120
parent 73a6e4ff
......@@ -135,6 +135,14 @@ found in existing mainstream languages:
protocol. Thus, the TFF tensor type is simply an abstract version of a
concrete physical representation of such type in Python or TensorFlow.
TFF's `TensorTypes` can be stricter in their (static) treatment of shapes
than TensorFlow. For example, TFF's typesystem treats a tensor with unknown
rank as assignable *from* any other tensor of the same `dtype`, but not
assignable *to* any tensor with fixed rank. This treatment prevents certain
runtime failures (e.g., attempting to reshape a tensor of unknown rank into
a shape with incorrect number of elements), at the cost of greater
strictness in what computations TFF accepts as valid.
The compact notation for tensor types is `dtype` or `dtype[shape]`. For
example, `int32` and `int32[10]` are the types of integers and int vectors,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment