Fix TPUEmbedding layer to use named parameters

PiperOrigin-RevId: 384784083
Change-Id: Ic74266e98885f251d76bb18ce501a8f9b1130ce7
diff --git a/tensorflow/python/tpu/tpu_embedding_v2_utils.py b/tensorflow/python/tpu/tpu_embedding_v2_utils.py
index 2752759..0c53581 100644
--- a/tensorflow/python/tpu/tpu_embedding_v2_utils.py
+++ b/tensorflow/python/tpu/tpu_embedding_v2_utils.py
@@ -884,6 +884,12 @@
     self.table = table
     self.max_sequence_length = max_sequence_length
     self.name = name
+
+    if not isinstance(
+        validate_weights_and_indices, bool):
+      raise ValueError("validate_weights_and_indices must be a bool, received "
+                       "{} instead.".format(validate_weights_and_indices))
+
     self.validate_weights_and_indices = validate_weights_and_indices
 
   def __repr__(self):