Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class EuclideanDistanceTransformGenerator {
int64 height_, width_;

public:
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
EuclideanDistanceTransformGenerator(typename TTypes<T, 4>::ConstTensor input)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EuclideanDistanceTransformGenerator(
typename TTypes<T, 4>::ConstTensor input)
: input_(input) {
height_ = input_.dimensions()[1];
width_ = input_.dimensions()[2];
Expand Down
15 changes: 7 additions & 8 deletions tensorflow_addons/image/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ def to_4D_image(image):
Returns:
4D tensor with the same type.
"""
# yapf:disable
with tf.control_dependencies([
tf.debugging.assert_rank_in(
image, [2, 3, 4], message='`image` must be 2/3/4D tensor')
tf.debugging.assert_rank_in( # pylint: disable=bad-continuation
image, [2, 3, 4],
message='`image` must be 2/3/4D tensor')
]):
# yapf: enable
ndims = image.get_shape().ndims
if ndims is None:
return _dynamic_to_4D_image(image)
Expand Down Expand Up @@ -81,12 +80,12 @@ def from_4D_image(image, ndims):
Returns:
`ndims`-D tensor with the same type.
"""
# yapf:disable
with tf.control_dependencies([
tf.debugging.assert_rank(
image, 4, message='`image` must be 4D tensor')
tf.debugging.assert_rank( # pylint: disable=bad-continuation
image,
4,
message='`image` must be 4D tensor')
]):
# yapf:enable
if isinstance(ndims, tf.Tensor):
return _dynamic_from_4D_image(image, ndims)
elif ndims == 2:
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_addons/optimizers/weight_decay_optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def extend_with_decoupled_weight_decay(base_optimizer):

optimizer = tfa.optimizers.AdamW(learning_rate=lr, weight_decay=wd)
```

Note: you might want to register your own custom optimizer using
`tf.keras.utils.get_custom_objects()`.

Expand Down
7 changes: 6 additions & 1 deletion tensorflow_addons/seq2seq/beam_search_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,13 @@ def _maybe_sort_array_beams(self, t, parent_ids, sequence_length):
self._beam_width):
return t
t = t.stack()
# yapf:disable
with tf.control_dependencies(
[_check_batch_beam(t, self._batch_size, self._beam_width)]):
[_check_batch_beam( # pylint: disable=bad-continuation
t,
self._batch_size,
self._beam_width)]):
# yapf:enable
return gather_tree_from_array(t, parent_ids, sequence_length)

def step(self, time, inputs, state, training=None, name=None):
Expand Down
4 changes: 2 additions & 2 deletions tools/ci_build/install/ci_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TODO: Upgrade pylint to 2.0 when python >= 3.4
pylint == 1.6.4
pylint == 1.9 ; python_version <= '2.7'
pylint == 2.3.1 ; python_version > '2.7'
docformatter == 1.1
yapf == 0.26.0
4 changes: 2 additions & 2 deletions tools/ci_build/install/install_ci_dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ if [[ ! -d "tensorflow_addons" ]]; then
exit 1
fi

# Install python
# Install python dependencies:
CI_REQUIREMENT="$SCRIPT_DIR/ci_requirements.txt"
pip install ${QUIET_FLAG} -r ${CI_REQUIREMENT}

# Check clang-format
# Check clang-format:
CLANG_FORMAT=${CLANG_FORMAT:-clang-format-3.8}
which ${CLANG_FORMAT} > /dev/null
if [[ $? != "0" ]]; then
Expand Down
1 change: 1 addition & 0 deletions tools/ci_build/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ disable=design,
# TODO: remove not-callable when pylint can understand tf export paradigm
not-callable,
similarities,
unsupported-assignment-operation,
useless-object-inheritance

# Enable the message, report, category or checker with the given id(s). You can
Expand Down