"docs/source/vscode:/vscode.git/clone" did not exist on "a02a5490baab3b4745844b0f0752fe746a0cb7bc"
Commit 3a8caa96 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 392931060
parent aaae2a9c
...@@ -175,7 +175,7 @@ def _convert_index(index, pos, m=None, is_start=True): ...@@ -175,7 +175,7 @@ def _convert_index(index, pos, m=None, is_start=True):
front -= 1 front -= 1
assert index[front] is not None or index[rear] is not None assert index[front] is not None or index[rear] is not None
if index[front] is None: if index[front] is None:
if index[rear] >= 1: if index[rear] >= 1: # pytype: disable=unsupported-operands
if is_start: if is_start:
return 0 return 0
else: else:
......
...@@ -48,15 +48,15 @@ def _flatten_dims(tensor: tf.Tensor, ...@@ -48,15 +48,15 @@ def _flatten_dims(tensor: tf.Tensor,
rank = tensor.shape.rank rank = tensor.shape.rank
if rank is None: if rank is None:
raise ValueError('Static rank of `tensor` must be known.') raise ValueError('Static rank of `tensor` must be known.')
if first_dim < 0: if first_dim < 0: # pytype: disable=unsupported-operands
first_dim += rank first_dim += rank
if first_dim < 0 or first_dim >= rank: if first_dim < 0 or first_dim >= rank: # pytype: disable=unsupported-operands
raise ValueError('`first_dim` out of bounds for `tensor` rank.') raise ValueError('`first_dim` out of bounds for `tensor` rank.')
if last_dim < 0: if last_dim < 0: # pytype: disable=unsupported-operands
last_dim += rank last_dim += rank
if last_dim < 0 or last_dim >= rank: if last_dim < 0 or last_dim >= rank: # pytype: disable=unsupported-operands
raise ValueError('`last_dim` out of bounds for `tensor` rank.') raise ValueError('`last_dim` out of bounds for `tensor` rank.')
if first_dim > last_dim: if first_dim > last_dim: # pytype: disable=unsupported-operands
raise ValueError('`first_dim` must not be larger than `last_dim`.') raise ValueError('`first_dim` must not be larger than `last_dim`.')
# Try to calculate static flattened dim size if all input sizes to flatten # Try to calculate static flattened dim size if all input sizes to flatten
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment