EagerTensor.__index__ now fails for non-integral dtypes
EagerTensor.__index__ now fails for non-integral dtypes

This mirrors NumPy behavior, e.g. prior to this change

>>> tf.constant(42.0).__index__()
42
>>> np.array(42.0).__index__()
Traceback (most recent call last):
  File "...", line 1, in <module>
    np.array(42.0).__index__()
TypeError: only integer scalar arrays can be converted to a scalar index

If this breaks you, explicitly cast the tensor to an integral type
before using it as an index.

PiperOrigin-RevId: 274338898

petewarden/tensorflow,freedomtan/tensorflow,Intel-Corporation/tensorflow,renyi533/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aam-at/tensorflow,gautam1858/tensorflow,ppwwyyxx/tensorflow,cxxgtxy/tensorflow,annarev/tensorflow,cxxgtxy/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,jhseu/tensorflow,freedomtan/tensorflow,karllessard/tensorflow,arborh/tensorflow,annarev/tensorflow,arborh/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,cxxgtxy/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,jhseu/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow,annarev/tensorflow,xzturn/tensorflow,aldian/tensorflow,Intel-Corporation/tensorflow,gautam1858/tensorflow,renyi533/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,adit-chandra/tensorflow,arborh/tensorflow,frreiss/tensorflow-fred,sarvex/tensorflow,renyi533/tensorflow,xzturn/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,freedomtan/tensorflow,Intel-tensorflow/tensorflow,aldian/tensorflow,frreiss/tensorflow-fred,arborh/tensorflow,frreiss/tensorflow-fred,arborh/tensorflow,frreiss/tensorflow-fred,xzturn/tensorflow,arborh/tensorflow,Intel-tensorflow/tensorflow,arborh/tensorflow,cxxgtxy/tensorflow,paolodedios/tensorflow,freedomtan/tensorflow,jhseu/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aam-at/tensorflow,tensorflow/tensorflow-pywrap_saved_model,sarvex/tensorflow,davidzchen/tensorflow,gautam1858/tensorflow,arborh/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,renyi533/tensorflow,freedomtan/tensorflow,jhseu/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-pywrap_saved_model,xzturn/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,petewarden/tensorflow,renyi533/tensorflow,aam-at/tensorflow,petewarden/tensorflow,jhseu/tensorflow,ppwwyyxx/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aldian/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,paolodedios/tensorflow,davidzchen/tensorflow,sarvex/tensorflow,annarev/tensorflow,gunan/tensorflow,aam-at/tensorflow,yongtang/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,renyi533/tensorflow,Intel-tensorflow/tensorflow,adit-chandra/tensorflow,gunan/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,xzturn/tensorflow,Intel-Corporation/tensorflow,ppwwyyxx/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,sarvex/tensorflow,karllessard/tensorflow,karllessard/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,paolodedios/tensorflow,gunan/tensorflow,aldian/tensorflow,gautam1858/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-experimental_link_static_libraries_once,jhseu/tensorflow,aldian/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,gunan/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,ppwwyyxx/tensorflow,aldian/tensorflow,sarvex/tensorflow,karllessard/tensorflow,ppwwyyxx/tensorflow,freedomtan/tensorflow,adit-chandra/tensorflow,aam-at/tensorflow,yongtang/tensorflow,arborh/tensorflow,aam-at/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,cxxgtxy/tensorflow,Intel-tensorflow/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,annarev/tensorflow,davidzchen/tensorflow,ppwwyyxx/tensorflow,davidzchen/tensorflow,aldian/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,xzturn/tensorflow,renyi533/tensorflow,adit-chandra/tensorflow,jhseu/tensorflow,Intel-Corporation/tensorflow,annarev/tensorflow,gautam1858/tensorflow,ppwwyyxx/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,davidzchen/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,cxxgtxy/tensorflow,davidzchen/tensorflow,adit-chandra/tensorflow,yongtang/tensorflow,jhseu/tensorflow,Intel-tensorflow/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,arborh/tensorflow,renyi533/tensorflow,karllessard/tensorflow,freedomtan/tensorflow,xzturn/tensorflow,adit-chandra/tensorflow,karllessard/tensorflow,frreiss/tensorflow-fred,sarvex/tensorflow,yongtang/tensorflow,davidzchen/tensorflow,adit-chandra/tensorflow,ppwwyyxx/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,jhseu/tensorflow,petewarden/tensorflow,adit-chandra/tensorflow,davidzchen/tensorflow,gunan/tensorflow,petewarden/tensorflow,jhseu/tensorflow,tensorflow/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,davidzchen/tensorflow,annarev/tensorflow,cxxgtxy/tensorflow,paolodedios/tensorflow,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,yongtang/tensorflow,arborh/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,freedomtan/tensorflow,xzturn/tensorflow,cxxgtxy/tensorflow,aam-at/tensorflow,Intel-Corporation/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,adit-chandra/tensorflow,gunan/tensorflow,renyi533/tensorflow,xzturn/tensorflow,renyi533/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,renyi533/tensorflow,annarev/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,yongtang/tensorflow,aldian/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aam-at/tensorflow,frreiss/tensorflow-fred,Intel-Corporation/tensorflow,ppwwyyxx/tensorflow,gunan/tensorflow,arborh/tensorflow,tensorflow/tensorflow,gunan/tensorflow,annarev/tensorflow,Intel-Corporation/tensorflow,annarev/tensorflow,adit-chandra/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,gunan/tensorflow,yongtang/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,ppwwyyxx/tensorflow,yongtang/tensorflow,ppwwyyxx/tensorflow,karllessard/tensorflow,karllessard/tensorflow,gunan/tensorflow,gautam1858/tensorflow,jhseu/tensorflow,Intel-tensorflow/tensorflow,xzturn/tensorflow