Skip to content

Commit

Permalink
Update generated numpy files
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 471273585
  • Loading branch information
csuter authored and tensorflower-gardener committed Aug 31, 2022
1 parent 02e3297 commit 3d94661
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ def tf_export(*args, **kwargs):
import operator
from typing import Optional, Sequence, Type

import six

# from tensorflow.core.framework import tensor_shape_pb2
# from tensorflow.core.function import trace_type
# from tensorflow.python import tf2
Expand Down Expand Up @@ -269,10 +267,10 @@ def __init__(self, value):
# TODO(b/143206389): Remove once we fully migrate to 3.X.
self._value = int(value.__index__())
except AttributeError:
six.raise_from(
TypeError("Dimension value must be integer or None or have "
"an __index__ method, got value '{0!r}' with type '{1!r}'"
.format(value, type(value))), None)
raise TypeError(
"Dimension value must be integer or None or have "
"an __index__ method, got value '{0!r}' with type '{1!r}'".format(
value, type(value))) from None
if self._value < 0:
raise ValueError("Dimension %d must be >= 0" % self._value)

Expand Down Expand Up @@ -855,13 +853,11 @@ def __init__(self, dims):
try:
self._dims.append(as_dimension(d).value)
except TypeError as e:
six.raise_from(
TypeError(
"Failed to convert '{0!r}' to a shape: '{1!r}'"
"could not be converted to a dimension. A shape should "
"either be single dimension (e.g. 10), or an iterable of "
"dimensions (e.g. [1, 10, None])."
.format(dims, d)), e)
raise TypeError(
"Failed to convert '{0!r}' to a shape: '{1!r}'"
"could not be converted to a dimension. A shape should "
"either be single dimension (e.g. 10), or an iterable of "
"dimensions (e.g. [1, 10, None]).".format(dims, d)) from e
self._dims = tuple(self._dims)

@property
Expand Down

0 comments on commit 3d94661

Please sign in to comment.