提交 89513c89 编辑于 作者: Keith Rush's avatar Keith Rush 提交者: tensorflow-copybara
浏览文件

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

PiperOrigin-RevId: 411173120
上级 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,
respectively.
......
Supports Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册