Make CPython implementation function type-correct, which removes UB from calling a function through a pointer of the wrong type, and also removes a C-style cast.
Make CPython implementation function type-correct, which removes UB from calling a function through a pointer of the wrong type, and also removes a C-style cast.

PiperOrigin-RevId: 196428430

meteorcloudy/tensorflow,hehongliang/tensorflow,theflofly/tensorflow,ghchinoy/tensorflow,frreiss/tensorflow-fred,renyi533/tensorflow,theflofly/tensorflow,cxxgtxy/tensorflow,apark263/tensorflow,davidzchen/tensorflow,benoitsteiner/tensorflow-xsmm,aam-at/tensorflow,xzturn/tensorflow,seanli9jan/tensorflow,chemelnucfin/tensorflow,ZhangXinNan/tensorflow,kobejean/tensorflow,jalexvig/tensorflow,Bismarrck/tensorflow,apark263/tensorflow,renyi533/tensorflow,asimshankar/tensorflow,jart/tensorflow,jart/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,ageron/tensorflow,drpngx/tensorflow,ghchinoy/tensorflow,jart/tensorflow,renyi533/tensorflow,Bismarrck/tensorflow,chemelnucfin/tensorflow,lukeiwanski/tensorflow,hehongliang/tensorflow,tensorflow/tensorflow,seanli9jan/tensorflow,aldian/tensorflow,jbedorf/tensorflow,petewarden/tensorflow,hehongliang/tensorflow,jendap/tensorflow,hfp/tensorflow-xsmm,AnishShah/tensorflow,brchiu/tensorflow,yanchen036/tensorflow,chemelnucfin/tensorflow,gojira/tensorflow,jhseu/tensorflow,DavidNorman/tensorflow,gunan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,snnn/tensorflow,yongtang/tensorflow,DavidNorman/tensorflow,freedomtan/tensorflow,dancingdan/tensorflow,arborh/tensorflow,aam-at/tensorflow,drpngx/tensorflow,Intel-Corporation/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,petewarden/tensorflow,DavidNorman/tensorflow,girving/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,manipopopo/tensorflow,seanli9jan/tensorflow,jhseu/tensorflow,gunan/tensorflow,theflofly/tensorflow,manipopopo/tensorflow,aam-at/tensorflow,meteorcloudy/tensorflow,seanli9jan/tensorflow,jhseu/tensorflow,karllessard/tensorflow,Intel-Corporation/tensorflow,dancingdan/tensorflow,arborh/tensorflow,gojira/tensorflow,renyi533/tensorflow,nburn42/tensorflow,cxxgtxy/tensorflow,frreiss/tensorflow-fred,alsrgv/tensorflow,yanchen036/tensorflow,Intel-Corporation/tensorflow,Bismarrck/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,ppwwyyxx/tensorflow,paolodedios/tensorflow,alsrgv/tensorflow,annarev/tensorflow,ageron/tensorflow,nburn42/tensorflow,lukeiwanski/tensorflow,hfp/tensorflow-xsmm,gunan/tensorflow,xzturn/tensorflow,AnishShah/tensorflow,aselle/tensorflow,jbedorf/tensorflow,snnn/tensorflow,kevin-coder/tensorflow-fork,annarev/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,aselle/tensorflow,caisq/tensorflow,asimshankar/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,annarev/tensorflow,tensorflow/tensorflow,jhseu/tensorflow,yanchen036/tensorflow,aam-at/tensorflow,dongjoon-hyun/tensorflow,apark263/tensorflow,ageron/tensorflow,sarvex/tensorflow,meteorcloudy/tensorflow,dongjoon-hyun/tensorflow,chemelnucfin/tensorflow,chemelnucfin/tensorflow,yongtang/tensorflow,gunan/tensorflow,davidzchen/tensorflow,kevin-coder/tensorflow-fork,gojira/tensorflow,alsrgv/tensorflow,annarev/tensorflow,aldian/tensorflow,lukeiwanski/tensorflow,brchiu/tensorflow,aselle/tensorflow,lukeiwanski/tensorflow,tensorflow/tensorflow,ZhangXinNan/tensorflow,theflofly/tensorflow,gautam1858/tensorflow,kobejean/tensorflow,petewarden/tensorflow,ageron/tensorflow,AnishShah/tensorflow,xodus7/tensorflow,theflofly/tensorflow,annarev/tensorflow,seanli9jan/tensorflow,nburn42/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,kobejean/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gojira/tensorflow,petewarden/tensorflow,snnn/tensorflow,renyi533/tensorflow,manipopopo/tensorflow,Bismarrck/tensorflow,paolodedios/tensorflow,kevin-coder/tensorflow-fork,dongjoon-hyun/tensorflow,dongjoon-hyun/tensorflow,yongtang/tensorflow,jalexvig/tensorflow,xzturn/tensorflow,theflofly/tensorflow,alsrgv/tensorflow,dongjoon-hyun/tensorflow,jhseu/tensorflow,benoitsteiner/tensorflow-xsmm,davidzchen/tensorflow,manipopopo/tensorflow,jendap/tensorflow,tensorflow/tensorflow,meteorcloudy/tensorflow,davidzchen/tensorflow,annarev/tensorflow,Intel-tensorflow/tensorflow,snnn/tensorflow,aldian/tensorflow,gojira/tensorflow,DavidNorman/tensorflow,girving/tensorflow,dancingdan/tensorflow,drpngx/tensorflow,jbedorf/tensorflow,gautam1858/tensorflow,xodus7/tensorflow,jalexvig/tensorflow,xzturn/tensorflow,jbedorf/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,manipopopo/tensorflow,AnishShah/tensorflow,benoitsteiner/tensorflow-xsmm,asimshankar/tensorflow,kobejean/tensorflow,jbedorf/tensorflow,snnn/tensorflow,tensorflow/tensorflow,hfp/tensorflow-xsmm,tensorflow/tensorflow-pywrap_tf_optimizer,caisq/tensorflow,nburn42/tensorflow,dongjoon-hyun/tensorflow,aselle/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jbedorf/tensorflow,karllessard/tensorflow,lukeiwanski/tensorflow,jhseu/tensorflow,asimshankar/tensorflow,DavidNorman/tensorflow,gunan/tensorflow,xzturn/tensorflow,xzturn/tensorflow,ghchinoy/tensorflow,benoitsteiner/tensorflow-xsmm,hehongliang/tensorflow,chemelnucfin/tensorflow,manipopopo/tensorflow,Bismarrck/tensorflow,arborh/tensorflow,apark263/tensorflow,manipopopo/tensorflow,dongjoon-hyun/tensorflow,jhseu/tensorflow,xodus7/tensorflow,freedomtan/tensorflow,jalexvig/tensorflow,hfp/tensorflow-xsmm,adit-chandra/tensorflow,aselle/tensorflow,alshedivat/tensorflow,DavidNorman/tensorflow,freedomtan/tensorflow,snnn/tensorflow,asimshankar/tensorflow,jendap/tensorflow,xodus7/tensorflow,Intel-tensorflow/tensorflow,aselle/tensorflow,ghchinoy/tensorflow,ZhangXinNan/tensorflow,karllessard/tensorflow,cxxgtxy/tensorflow,arborh/tensorflow,Bismarrck/tensorflow,jart/tensorflow,jendap/tensorflow,benoitsteiner/tensorflow-xsmm,ageron/tensorflow,lukeiwanski/tensorflow,arborh/tensorflow,jendap/tensorflow,nburn42/tensorflow,davidzchen/tensorflow,drpngx/tensorflow,lukeiwanski/tensorflow,gunan/tensorflow,ppwwyyxx/tensorflow,paolodedios/tensorflow,freedomtan/tensorflow,frreiss/tensorflow-fred,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,dongjoon-hyun/tensorflow,tensorflow/tensorflow-pywrap_saved_model,alshedivat/tensorflow,Intel-tensorflow/tensorflow,ppwwyyxx/tensorflow,adit-chandra/tensorflow,caisq/tensorflow,lukeiwanski/tensorflow,dongjoon-hyun/tensorflow,xodus7/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,adit-chandra/tensorflow,annarev/tensorflow,alshedivat/tensorflow,jhseu/tensorflow,dendisuhubdy/tensorflow,ZhangXinNan/tensorflow,hehongliang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,ghchinoy/tensorflow,aldian/tensorflow,theflofly/tensorflow,lukeiwanski/tensorflow,renyi533/tensorflow,alshedivat/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,kobejean/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_saved_model,benoitsteiner/tensorflow-xsmm,dendisuhubdy/tensorflow,ZhangXinNan/tensorflow,kevin-coder/tensorflow-fork,gojira/tensorflow,davidzchen/tensorflow,hehongliang/tensorflow,freedomtan/tensorflow,ghchinoy/tensorflow,caisq/tensorflow,dongjoon-hyun/tensorflow,petewarden/tensorflow,apark263/tensorflow,meteorcloudy/tensorflow,brchiu/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,benoitsteiner/tensorflow-xsmm,aam-at/tensorflow,jendap/tensorflow,girving/tensorflow,dendisuhubdy/tensorflow,xodus7/tensorflow,girving/tensorflow,gojira/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_saved_model,hfp/tensorflow-xsmm,karllessard/tensorflow,ppwwyyxx/tensorflow,jart/tensorflow,jendap/tensorflow,kevin-coder/tensorflow-fork,xzturn/tensorflow,gojira/tensorflow,girving/tensorflow,gautam1858/tensorflow,jalexvig/tensorflow,tensorflow/tensorflow,ghchinoy/tensorflow,brchiu/tensorflow,apark263/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gunan/tensorflow,aselle/tensorflow,snnn/tensorflow,jbedorf/tensorflow,hfp/tensorflow-xsmm,ppwwyyxx/tensorflow,asimshankar/tensorflow,kobejean/tensorflow,sarvex/tensorflow,tensorflow/tensorflow,ghchinoy/tensorflow,snnn/tensorflow,seanli9jan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,annarev/tensorflow,caisq/tensorflow,brchiu/tensorflow,kobejean/tensorflow,frreiss/tensorflow-fred,jart/tensorflow,snnn/tensorflow,dancingdan/tensorflow,aam-at/tensorflow,chemelnucfin/tensorflow,caisq/tensorflow,hfp/tensorflow-xsmm,nburn42/tensorflow,girving/tensorflow,brchiu/tensorflow,ppwwyyxx/tensorflow,apark263/tensorflow,drpngx/tensorflow,DavidNorman/tensorflow,seanli9jan/tensorflow,tensorflow/tensorflow,DavidNorman/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,annarev/tensorflow,xzturn/tensorflow,jart/tensorflow,benoitsteiner/tensorflow-xsmm,jbedorf/tensorflow,dendisuhubdy/tensorflow,karllessard/tensorflow,benoitsteiner/tensorflow-xsmm,jendap/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,manipopopo/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,petewarden/tensorflow,davidzchen/tensorflow,jalexvig/tensorflow,sarvex/tensorflow,theflofly/tensorflow,brchiu/tensorflow,aldian/tensorflow,ageron/tensorflow,cxxgtxy/tensorflow,petewarden/tensorflow,yanchen036/tensorflow,girving/tensorflow,caisq/tensorflow,cxxgtxy/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-pywrap_tf_optimizer,ageron/tensorflow,dancingdan/tensorflow,benoitsteiner/tensorflow-xsmm,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,xzturn/tensorflow,AnishShah/tensorflow,hehongliang/tensorflow,yanchen036/tensorflow,paolodedios/tensorflow,xodus7/tensorflow,yongtang/tensorflow,sarvex/tensorflow,AnishShah/tensorflow,annarev/tensorflow,meteorcloudy/tensorflow,girving/tensorflow,Bismarrck/tensorflow,AnishShah/tensorflow,dendisuhubdy/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-experimental_link_static_libraries_once,jhseu/tensorflow,dongjoon-hyun/tensorflow,brchiu/tensorflow,arborh/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-pywrap_saved_model,freedomtan/tensorflow,chemelnucfin/tensorflow,ZhangXinNan/tensorflow,aldian/tensorflow,jbedorf/tensorflow,freedomtan/tensorflow,yongtang/tensorflow,arborh/tensorflow,ageron/tensorflow,kevin-coder/tensorflow-fork,chemelnucfin/tensorflow,alsrgv/tensorflow,ghchinoy/tensorflow,petewarden/tensorflow,annarev/tensorflow,frreiss/tensorflow-fred,seanli9jan/tensorflow,kobejean/tensorflow,arborh/tensorflow,alshedivat/tensorflow,meteorcloudy/tensorflow,jendap/tensorflow,drpngx/tensorflow,yongtang/tensorflow,aldian/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ghchinoy/tensorflow,drpngx/tensorflow,Intel-tensorflow/tensorflow,Bismarrck/tensorflow,freedomtan/tensorflow,jbedorf/tensorflow,petewarden/tensorflow,frreiss/tensorflow-fred,dancingdan/tensorflow,chemelnucfin/tensorflow,jalexvig/tensorflow,hfp/tensorflow-xsmm,gunan/tensorflow,snnn/tensorflow,adit-chandra/tensorflow,kevin-coder/tensorflow-fork,seanli9jan/tensorflow,arborh/tensorflow,davidzchen/tensorflow,adit-chandra/tensorflow,kobejean/tensorflow,cxxgtxy/tensorflow,sarvex/tensorflow,adit-chandra/tensorflow,ppwwyyxx/tensorflow,AnishShah/tensorflow,gojira/tensorflow,xzturn/tensorflow,Bismarrck/tensorflow,karllessard/tensorflow,jalexvig/tensorflow,dancingdan/tensorflow,gautam1858/tensorflow,kevin-coder/tensorflow-fork,chemelnucfin/tensorflow,frreiss/tensorflow-fred,xodus7/tensorflow,hfp/tensorflow-xsmm,adit-chandra/tensorflow,benoitsteiner/tensorflow-xsmm,arborh/tensorflow,asimshankar/tensorflow,drpngx/tensorflow,cxxgtxy/tensorflow,jbedorf/tensorflow,jhseu/tensorflow,ZhangXinNan/tensorflow,aam-at/tensorflow,dendisuhubdy/tensorflow,dancingdan/tensorflow,gautam1858/tensorflow,aselle/tensorflow,jalexvig/tensorflow,asimshankar/tensorflow,alsrgv/tensorflow,alshedivat/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,ppwwyyxx/tensorflow,xodus7/tensorflow,dancingdan/tensorflow,gautam1858/tensorflow,asimshankar/tensorflow,karllessard/tensorflow,dancingdan/tensorflow,ghchinoy/tensorflow,gojira/tensorflow,nburn42/tensorflow,dendisuhubdy/tensorflow,davidzchen/tensorflow,sarvex/tensorflow,seanli9jan/tensorflow,sarvex/tensorflow,AnishShah/tensorflow,aam-at/tensorflow,renyi533/tensorflow,xzturn/tensorflow,ageron/tensorflow,meteorcloudy/tensorflow,dendisuhubdy/tensorflow,yanchen036/tensorflow,karllessard/tensorflow,DavidNorman/tensorflow,meteorcloudy/tensorflow,freedomtan/tensorflow,nburn42/tensorflow,jalexvig/tensorflow,apark263/tensorflow,jalexvig/tensorflow,tensorflow/tensorflow-pywrap_saved_model,cxxgtxy/tensorflow,aam-at/tensorflow,apark263/tensorflow,dancingdan/tensorflow,seanli9jan/tensorflow,aselle/tensorflow,frreiss/tensorflow-fred,chemelnucfin/tensorflow,brchiu/tensorflow,karllessard/tensorflow,yanchen036/tensorflow,alsrgv/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,gojira/tensorflow,renyi533/tensorflow,davidzchen/tensorflow,karllessard/tensorflow,brchiu/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,snnn/tensorflow,jart/tensorflow,Intel-Corporation/tensorflow,alsrgv/tensorflow,gunan/tensorflow,theflofly/tensorflow,gautam1858/tensorflow,jbedorf/tensorflow,ageron/tensorflow,ZhangXinNan/tensorflow,Bismarrck/tensorflow,DavidNorman/tensorflow,Intel-Corporation/tensorflow,ZhangXinNan/tensorflow,dendisuhubdy/tensorflow,jhseu/tensorflow,gunan/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,frreiss/tensorflow-fred,nburn42/tensorflow,nburn42/tensorflow,xodus7/tensorflow,yongtang/tensorflow,caisq/tensorflow,theflofly/tensorflow,brchiu/tensorflow,manipopopo/tensorflow,apark263/tensorflow,alsrgv/tensorflow,AnishShah/tensorflow,karllessard/tensorflow,lukeiwanski/tensorflow,aselle/tensorflow,meteorcloudy/tensorflow,xzturn/tensorflow,alsrgv/tensorflow,dendisuhubdy/tensorflow,ppwwyyxx/tensorflow,Bismarrck/tensorflow,theflofly/tensorflow,alsrgv/tensorflow,caisq/tensorflow,alsrgv/tensorflow,AnishShah/tensorflow,kevin-coder/tensorflow-fork,jendap/tensorflow,adit-chandra/tensorflow,Intel-tensorflow/tensorflow,ZhangXinNan/tensorflow,alshedivat/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,apark263/tensorflow,manipopopo/tensorflow,ZhangXinNan/tensorflow,nburn42/tensorflow,xodus7/tensorflow,paolodedios/tensorflow,girving/tensorflow,ageron/tensorflow,Intel-tensorflow/tensorflow,hfp/tensorflow-xsmm,tensorflow/tensorflow-pywrap_saved_model,alshedivat/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,yanchen036/tensorflow,alshedivat/tensorflow,petewarden/tensorflow,manipopopo/tensorflow,asimshankar/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,renyi533/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,alshedivat/tensorflow,adit-chandra/tensorflow,aselle/tensorflow,renyi533/tensorflow,adit-chandra/tensorflow,Intel-Corporation/tensorflow,jart/tensorflow,theflofly/tensorflow,paolodedios/tensorflow,renyi533/tensorflow,aldian/tensorflow,ppwwyyxx/tensorflow,drpngx/tensorflow,hfp/tensorflow-xsmm,tensorflow/tensorflow-pywrap_tf_optimizer,arborh/tensorflow,alshedivat/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,paolodedios/tensorflow,kobejean/tensorflow,adit-chandra/tensorflow,asimshankar/tensorflow,frreiss/tensorflow-fred,kobejean/tensorflow,girving/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,ageron/tensorflow,gautam1858/tensorflow,girving/tensorflow,jhseu/tensorflow,arborh/tensorflow,sarvex/tensorflow,ppwwyyxx/tensorflow,gautam1858/tensorflow,DavidNorman/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,caisq/tensorflow,jendap/tensorflow,aam-at/tensorflow,drpngx/tensorflow,ghchinoy/tensorflow,DavidNorman/tensorflow,tensorflow/tensorflow,jart/tensorflow,davidzchen/tensorflow