CounterCell stores each value of a Counter.
| 140 | |
| 141 | |
| 142 | class CounterCell(object): |
| 143 | """CounterCell stores each value of a Counter.""" |
| 144 | |
| 145 | def __init__(self, cell): |
| 146 | """Creates a new CounterCell. |
| 147 | |
| 148 | Args: |
| 149 | cell: A c pointer of TFE_MonitoringCounterCell. |
| 150 | """ |
| 151 | self._cell = cell |
| 152 | |
| 153 | def increase_by(self, value): |
| 154 | """Atomically increments the value. |
| 155 | |
| 156 | Args: |
| 157 | value: non-negative value. |
| 158 | """ |
| 159 | pywrap_tensorflow.TFE_MonitoringCounterCellIncrementBy(self._cell, value) |
| 160 | |
| 161 | def value(self): |
| 162 | """Retrieves the current value.""" |
| 163 | return pywrap_tensorflow.TFE_MonitoringCounterCellValue(self._cell) |
| 164 | |
| 165 | |
| 166 | class Counter(Metric): |