调用单个分支函数的n-way switch 语句。
用法
tf.raw_ops.Case(
branch_index, input, Tout, branches, output_shapes=[], name=None
)
参数
-
branch_index
Tensor
类型为int32
。分支选择器,一个 int32 张量。 -
input
Tensor
对象的列表。传递给分支函数的输入张量列表。 -
Tout
tf.DTypes
的列表。输出类型列表。 -
branches
用 @Defun 修饰的函数列表,长度为>= 1
。一个函数列表,每个函数都接受 'inputs' 并返回一个张量列表,其类型与每个其他分支返回的类型相同。 -
output_shapes
可选的形状列表(每个tf.TensorShape
或ints
列表)。默认为[]
。 -
name
操作的名称(可选)。
返回
-
类型为
Tout
的Tensor
对象的列表。
An n-way switch statement, implementing the following:
```
switch (branch_index) {
case 0:
output = branches[0](input);
break;
case 1:
output = branches[1](input);
break;
...
case [[nbranches-1]]:
default:
output = branches[nbranches-1](input);
break;
}
```
相关用法
- Python tf.raw_ops.ComplexAbs用法及代码示例
- Python tf.raw_ops.Conv2D用法及代码示例
- Python tf.raw_ops.Cos用法及代码示例
- Python tf.raw_ops.CheckNumerics用法及代码示例
- Python tf.raw_ops.Cumsum用法及代码示例
- Python tf.raw_ops.Conj用法及代码示例
- Python tf.raw_ops.Cosh用法及代码示例
- Python tf.raw_ops.Complex用法及代码示例
- Python tf.raw_ops.Cumprod用法及代码示例
- Python tf.raw_ops.CumulativeLogsumexp用法及代码示例
- Python tf.raw_ops.ConcatOffset用法及代码示例
- Python tf.raw_ops.TPUReplicatedInput用法及代码示例
- Python tf.raw_ops.Bitcast用法及代码示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代码示例
- Python tf.raw_ops.BatchMatMul用法及代码示例
- Python tf.raw_ops.OneHot用法及代码示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代码示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代码示例
- Python tf.raw_ops.GatherV2用法及代码示例
- Python tf.raw_ops.Expm1用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.raw_ops.Case。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。