Support tf.colocate_with when input is Tensor-like and executing_eagerly().
Support tf.colocate_with when input is Tensor-like and executing_eagerly().

Graph.colocate_with applies the private function _op_to_colocate_with, which does tensor conversions if not already an Operation. This is not true for the TF op tf.colocate_with.

This specific edge case appears in the following link. Alternative solutions are welcome.

* Pull request: https://github.com/tensorflow/tensor2tensor/pull/1182/files#diff-c7da3e2b2808bb202eddd84075267eceR265
* Aforementioned parent method: https://github.com/tensorflow/tensorflow/blob/r1.12/tensorflow/python/keras/engine/base_layer.py#L629

PiperOrigin-RevId: 219414649

DavidNorman/tensorflow,renyi533/tensorflow,jhseu/tensorflow,frreiss/tensorflow-fred,xzturn/tensorflow,gautam1858/tensorflow,dongjoon-hyun/tensorflow,yongtang/tensorflow,jbedorf/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,ghchinoy/tensorflow,kevin-coder/tensorflow-fork,aam-at/tensorflow,ageron/tensorflow,karllessard/tensorflow,arborh/tensorflow,DavidNorman/tensorflow,alsrgv/tensorflow,davidzchen/tensorflow,gautam1858/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,seanli9jan/tensorflow,Intel-tensorflow/tensorflow,seanli9jan/tensorflow,sarvex/tensorflow,DavidNorman/tensorflow,chemelnucfin/tensorflow,ageron/tensorflow,aldian/tensorflow,jendap/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aam-at/tensorflow,gunan/tensorflow,hfp/tensorflow-xsmm,arborh/tensorflow,arborh/tensorflow,tensorflow/tensorflow-pywrap_saved_model,adit-chandra/tensorflow,gautam1858/tensorflow,cxxgtxy/tensorflow,paolodedios/tensorflow,seanli9jan/tensorflow,hfp/tensorflow-xsmm,asimshankar/tensorflow,ghchinoy/tensorflow,gautam1858/tensorflow,petewarden/tensorflow,dongjoon-hyun/tensorflow,ppwwyyxx/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,Bismarrck/tensorflow,seanli9jan/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,karllessard/tensorflow,ppwwyyxx/tensorflow,aldian/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,aam-at/tensorflow,DavidNorman/tensorflow,petewarden/tensorflow,davidzchen/tensorflow,ppwwyyxx/tensorflow,sarvex/tensorflow,Bismarrck/tensorflow,aldian/tensorflow,adit-chandra/tensorflow,hehongliang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,jhseu/tensorflow,hfp/tensorflow-xsmm,hfp/tensorflow-xsmm,asimshankar/tensorflow,chemelnucfin/tensorflow,theflofly/tensorflow,Bismarrck/tensorflow,chemelnucfin/tensorflow,xzturn/tensorflow,paolodedios/tensorflow,DavidNorman/tensorflow,alsrgv/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-pywrap_saved_model,cxxgtxy/tensorflow,aam-at/tensorflow,chemelnucfin/tensorflow,aam-at/tensorflow,theflofly/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-pywrap_saved_model,theflofly/tensorflow,aldian/tensorflow,alsrgv/tensorflow,tensorflow/tensorflow-pywrap_saved_model,seanli9jan/tensorflow,jendap/tensorflow,alsrgv/tensorflow,chemelnucfin/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,karllessard/tensorflow,arborh/tensorflow,apark263/tensorflow,Bismarrck/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,ageron/tensorflow,tensorflow/tensorflow,kevin-coder/tensorflow-fork,renyi533/tensorflow,dongjoon-hyun/tensorflow,hehongliang/tensorflow,davidzchen/tensorflow,ageron/tensorflow,alsrgv/tensorflow,dongjoon-hyun/tensorflow,brchiu/tensorflow,alsrgv/tensorflow,jbedorf/tensorflow,jendap/tensorflow,jhseu/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,paolodedios/tensorflow,jhseu/tensorflow,aam-at/tensorflow,hfp/tensorflow-xsmm,adit-chandra/tensorflow,arborh/tensorflow,arborh/tensorflow,theflofly/tensorflow,hehongliang/tensorflow,gautam1858/tensorflow,theflofly/tensorflow,renyi533/tensorflow,ghchinoy/tensorflow,renyi533/tensorflow,asimshankar/tensorflow,gunan/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,gunan/tensorflow,ghchinoy/tensorflow,adit-chandra/tensorflow,gunan/tensorflow,brchiu/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Bismarrck/tensorflow,ghchinoy/tensorflow,Intel-Corporation/tensorflow,asimshankar/tensorflow,paolodedios/tensorflow,jbedorf/tensorflow,dongjoon-hyun/tensorflow,asimshankar/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,cxxgtxy/tensorflow,jbedorf/tensorflow,davidzchen/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,dongjoon-hyun/tensorflow,gunan/tensorflow,hfp/tensorflow-xsmm,ppwwyyxx/tensorflow,jbedorf/tensorflow,jendap/tensorflow,kevin-coder/tensorflow-fork,asimshankar/tensorflow,paolodedios/tensorflow,jbedorf/tensorflow,aam-at/tensorflow,gautam1858/tensorflow,petewarden/tensorflow,annarev/tensorflow,jhseu/tensorflow,adit-chandra/tensorflow,apark263/tensorflow,apark263/tensorflow,chemelnucfin/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow,annarev/tensorflow,DavidNorman/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,aldian/tensorflow,renyi533/tensorflow,xzturn/tensorflow,ppwwyyxx/tensorflow,ghchinoy/tensorflow,hehongliang/tensorflow,apark263/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,jendap/tensorflow,davidzchen/tensorflow,DavidNorman/tensorflow,Bismarrck/tensorflow,hehongliang/tensorflow,apark263/tensorflow,jendap/tensorflow,cxxgtxy/tensorflow,aam-at/tensorflow,alsrgv/tensorflow,apark263/tensorflow,karllessard/tensorflow,adit-chandra/tensorflow,freedomtan/tensorflow,xzturn/tensorflow,davidzchen/tensorflow,jbedorf/tensorflow,frreiss/tensorflow-fred,brchiu/tensorflow,kevin-coder/tensorflow-fork,yongtang/tensorflow,brchiu/tensorflow,jbedorf/tensorflow,davidzchen/tensorflow,frreiss/tensorflow-fred,asimshankar/tensorflow,ageron/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,alsrgv/tensorflow,dongjoon-hyun/tensorflow,kevin-coder/tensorflow-fork,adit-chandra/tensorflow,ghchinoy/tensorflow,tensorflow/tensorflow,seanli9jan/tensorflow,ghchinoy/tensorflow,ghchinoy/tensorflow,jbedorf/tensorflow,ageron/tensorflow,ppwwyyxx/tensorflow,paolodedios/tensorflow,frreiss/tensorflow-fred,DavidNorman/tensorflow,theflofly/tensorflow,Intel-Corporation/tensorflow,asimshankar/tensorflow,hehongliang/tensorflow,yongtang/tensorflow,xzturn/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,kevin-coder/tensorflow-fork,theflofly/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,adit-chandra/tensorflow,cxxgtxy/tensorflow,chemelnucfin/tensorflow,seanli9jan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jendap/tensorflow,ageron/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,ageron/tensorflow,xzturn/tensorflow,cxxgtxy/tensorflow,gunan/tensorflow,karllessard/tensorflow,annarev/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,freedomtan/tensorflow,adit-chandra/tensorflow,theflofly/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,annarev/tensorflow,ageron/tensorflow,Intel-tensorflow/tensorflow,arborh/tensorflow,xzturn/tensorflow,gunan/tensorflow,dongjoon-hyun/tensorflow,apark263/tensorflow,jhseu/tensorflow,gunan/tensorflow,Intel-Corporation/tensorflow,Bismarrck/tensorflow,sarvex/tensorflow,apark263/tensorflow,alsrgv/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,kevin-coder/tensorflow-fork,brchiu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,seanli9jan/tensorflow,xzturn/tensorflow,freedomtan/tensorflow,Bismarrck/tensorflow,aldian/tensorflow,petewarden/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ageron/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ppwwyyxx/tensorflow,brchiu/tensorflow,kevin-coder/tensorflow-fork,arborh/tensorflow,hehongliang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,davidzchen/tensorflow,yongtang/tensorflow,DavidNorman/tensorflow,DavidNorman/tensorflow,jendap/tensorflow,ppwwyyxx/tensorflow,davidzchen/tensorflow,chemelnucfin/tensorflow,petewarden/tensorflow,tensorflow/tensorflow,renyi533/tensorflow,yongtang/tensorflow,adit-chandra/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,xzturn/tensorflow,jbedorf/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jhseu/tensorflow,aldian/tensorflow,xzturn/tensorflow,frreiss/tensorflow-fred,dongjoon-hyun/tensorflow,xzturn/tensorflow,brchiu/tensorflow,arborh/tensorflow,annarev/tensorflow,hfp/tensorflow-xsmm,tensorflow/tensorflow-experimental_link_static_libraries_once,DavidNorman/tensorflow,renyi533/tensorflow,Intel-Corporation/tensorflow,brchiu/tensorflow,asimshankar/tensorflow,theflofly/tensorflow,arborh/tensorflow,jhseu/tensorflow,ghchinoy/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,hfp/tensorflow-xsmm,kevin-coder/tensorflow-fork,hfp/tensorflow-xsmm,sarvex/tensorflow,karllessard/tensorflow,seanli9jan/tensorflow,gautam1858/tensorflow,jhseu/tensorflow,Bismarrck/tensorflow,alsrgv/tensorflow,Intel-Corporation/tensorflow,apark263/tensorflow,davidzchen/tensorflow,annarev/tensorflow,petewarden/tensorflow,ageron/tensorflow,chemelnucfin/tensorflow,sarvex/tensorflow,davidzchen/tensorflow,xzturn/tensorflow,tensorflow/tensorflow,renyi533/tensorflow,ghchinoy/tensorflow,jbedorf/tensorflow,brchiu/tensorflow,frreiss/tensorflow-fred,Bismarrck/tensorflow,ppwwyyxx/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,sarvex/tensorflow,freedomtan/tensorflow,hfp/tensorflow-xsmm,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,ppwwyyxx/tensorflow,seanli9jan/tensorflow,petewarden/tensorflow,theflofly/tensorflow,aam-at/tensorflow,aldian/tensorflow,renyi533/tensorflow,arborh/tensorflow,jhseu/tensorflow,annarev/tensorflow,cxxgtxy/tensorflow,jhseu/tensorflow,sarvex/tensorflow,seanli9jan/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,hfp/tensorflow-xsmm,gautam1858/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,cxxgtxy/tensorflow,jendap/tensorflow,jhseu/tensorflow,freedomtan/tensorflow,aam-at/tensorflow,adit-chandra/tensorflow,theflofly/tensorflow,alsrgv/tensorflow,apark263/tensorflow,alsrgv/tensorflow,paolodedios/tensorflow,apark263/tensorflow,asimshankar/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,yongtang/tensorflow,annarev/tensorflow,DavidNorman/tensorflow,annarev/tensorflow,Intel-Corporation/tensorflow,asimshankar/tensorflow,Intel-Corporation/tensorflow,Bismarrck/tensorflow,ghchinoy/tensorflow,theflofly/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,dongjoon-hyun/tensorflow,brchiu/tensorflow,arborh/tensorflow,yongtang/tensorflow,freedomtan/tensorflow,annarev/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gunan/tensorflow,karllessard/tensorflow,kevin-coder/tensorflow-fork,jendap/tensorflow,ageron/tensorflow,davidzchen/tensorflow,jendap/tensorflow,ppwwyyxx/tensorflow,dongjoon-hyun/tensorflow,annarev/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,adit-chandra/tensorflow,jbedorf/tensorflow,tensorflow/tensorflow,brchiu/tensorflow