aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/ops/special_math_ops.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/ops/special_math_ops.py')
-rw-r--r--tensorflow/python/ops/special_math_ops.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/python/ops/special_math_ops.py b/tensorflow/python/ops/special_math_ops.py
index 6d7eaababc..5e2146b79f 100644
--- a/tensorflow/python/ops/special_math_ops.py
+++ b/tensorflow/python/ops/special_math_ops.py
@@ -163,7 +163,7 @@ def einsum(equation, *inputs, **kwargs):
if '...' in equation:
raise ValueError('Subscripts with ellipses are not yet supported.')
- match = re.match('([a-z,]+)(->[a-z]*)?', equation)
+ match = re.match('^([a-zA-Z,]+)(->[a-zA-Z]*)?$', equation)
if not match:
raise ValueError('Indices have incorrect format: %s' % equation)
@@ -402,7 +402,7 @@ def _exponential_space_einsum(equation, *inputs):
if '...' in equation:
raise ValueError('Subscripts with ellipses are not yet supported.')
- match = re.match('([a-z,]+)(->[a-z]*)?', equation)
+ match = re.match('^([a-zA-Z,]+)(->[a-zA-Z]*)?$', equation)
if not match:
raise ValueError('Indices have incorrect format: %s' % equation)