Given list of tensor shape values, returns total size. If shape_values contains tensor values (which are results of array_ops.shape), then it returns a scalar tensor. If not, it returns an integer.
(shape_values)
| 555 | |
| 556 | |
| 557 | def _total_size(shape_values): |
| 558 | """Given list of tensor shape values, returns total size. |
| 559 | If shape_values contains tensor values (which are results of |
| 560 | array_ops.shape), then it returns a scalar tensor. |
| 561 | If not, it returns an integer.""" |
| 562 | |
| 563 | result = 1 |
| 564 | for val in shape_values: |
| 565 | result *= val |
| 566 | return result |
| 567 | |
| 568 | |
| 569 | def _exponential_space_einsum(equation, *inputs): |