Count the total number of scalars composing the weights. Arguments: weights: An iterable containing the weights on which to compute params Returns: The total number of scalars composing the weights
(weights)
| 68 | |
| 69 | |
| 70 | def count_params(weights): |
| 71 | """Count the total number of scalars composing the weights. |
| 72 | |
| 73 | Arguments: |
| 74 | weights: An iterable containing the weights on which to compute params |
| 75 | |
| 76 | Returns: |
| 77 | The total number of scalars composing the weights |
| 78 | """ |
| 79 | return int( |
| 80 | sum( |
| 81 | np.prod(p.shape.as_list()) |
| 82 | for p in object_identity.ObjectIdentitySet(weights))) |
| 83 | |
| 84 | |
| 85 | def print_summary(model, line_length=None, positions=None, print_fn=None): |
no test coverage detected