Alternative implementation of tf.nn.bias_add which is compatiable with tensorRT.
(x, b, data_format)
| 98 | |
| 99 | |
| 100 | def _bias_add(x, b, data_format): |
| 101 | """Alternative implementation of tf.nn.bias_add which is compatiable with tensorRT.""" |
| 102 | if data_format == 'NHWC': |
| 103 | return tf.add(x, b) |
| 104 | elif data_format == 'NCHW': |
| 105 | return tf.add(x, b) |
| 106 | else: |
| 107 | raise ValueError('invalid data_format: %s' % data_format) |
| 108 | |
| 109 | |
| 110 | def _compute_shape(tensors): |
no test coverage detected
searching dependent graphs…