Ask NumPy for read only array when converting it to Tensor.
Ask NumPy for read only array when converting it to Tensor.

Fix for: #17315

If numpy array is read-only, calling PyArray_FromAny with NPY_ARRAY_CARRAY
flags introduce extra memory copy.

Before:
  feed_cpu_variable_read_only: 5.6 GB/sec, min: 17.99, median: 19.54, mean: 19.76

After:
  feed_cpu_variable_read_only: 13.2 GB/sec, min: 7.60, median: 7.78, mean: 8.13
PiperOrigin-RevId: 199835695

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