
    AVh$
             %       j   d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZm Z m!Z! ddl"m#Z#  ejH                  dddg      Z% edddd      Z&ejN                  ejP                   ed      dde#e!e&f   de)de)de*de+de)d e+fd!                     Z,  ed"       ejZ                  e,            Z.e,j^                  j`                  Z1de#e!e&f   de)de)de*de+de)d e+fd#Z2 ed$ddd%d      Z3dd'e#e!e3f   d(e4d)e4d*e#e!e3f   fd+Z5  ed,       ejZ                  e5            Z6d'e#e!e3f   d(e4d)e4d*e#e!e3f   fd-Z7 ed.ddd%d      Z8dde#e!e8f   d(e4d)e4d*e#e!e8f   fd0Z9  ed1       ejZ                  e9            Z:de#e!e8f   d(e4d)e4d*e#e!e8f   fd2Z; ed3ddd%d      Z<dd4e#e!ejz                  f   d5e#e!e<f   d(e4d)e4d*e#e!e<f   f
d6Z>  ed7       ejZ                  e>            Z?d4e#e!ejz                  f   d5e#e!e<f   d(e4d)e4d*e#e!e<f   f
d8Z@ ed9ddd%d      ZAdd4e#e!ejz                  f   d5e#e!eAf   d(e4d)e4d*e#e!eAf   f
d:ZB  ed;       ejZ                  eB            ZCd4e#e!ejz                  f   d5e#e!eAf   d(e4d)e4d*e#e!eAf   f
d<ZD ed=dd>d?dd%dd@dAdBdCdDdEdFdGdHdIdJdKdL      ZEddMe#e!eEf   dNe#e!eEf   dOe#e!eEf   dPe#e!eEf   dQe#e!eEf   dRe*dSe+d*e#e!eEf   fdTZF  edU       ejZ                  eF            ZGdMe#e!eEf   dNe#e!eEf   dOe#e!eEf   dPe#e!eEf   dQe#e!eEf   dRe*dSe+d*e#e!eEf   fdVZH ejH                  dWg dX      ZI edYdd>d?dd%dd@dAdBdCdDdEdFdGdHdIdJdKdL      ZJddMe#e!eJf   dNe#e!eJf   dOe#e!eJf   dQe#e!eJf   dZe#e!eJf   dRe*dSe+fd[ZK  ed\       ejZ                  eK            ZLdMe#e!eJf   dNe#e!eJf   dOe#e!eJf   dQe#e!eJf   dZe#e!eJf   dRe*dSe+fd]ZM ed^dd>d?dd%dd@dAdBdCdDdEdFdGdHdIdJdKdL      ZNdd'e#e!eNf   d_e#e!eNf   d)e4d*e#e!eNf   fd`ZO  eda       ejZ                  eO            ZPd'e#e!eNf   d_e#e!eNf   d)e4d*e#e!eNf   fdbZQ edcdd>d?dd%dd@dAdBdCdDdEdFdGdHdIdJdKdL      ZRddde#e!eRf   d)e4d*e#e!eRf   fdeZS  edf       ejZ                  eS            ZTdde#e!eRf   d)e4d*e#e!eRf   fdgZU edhdd>d?dd%dd@dAdBdCdDdEdFdGdHdIdJdKdL      ZVdd'e#e!eVf   d_e#e!eVf   d*e#e!eVf   fdiZW  edj       ejZ                  eW            ZXd'e#e!eVf   d_e#e!eVf   d*e#e!eVf   fdkZY edlddd%ddA      ZZejN                  ejP                   edm      g dng dododfde#e!eZf   dpe#e!eZf   d(e4d)e4dqe)dre)d*e#e!eZf   fds                     Z[  edt       ejZ                  e[            Z\e[j^                  j`                  Z]de#e!eZf   dpe#e!eZf   d(e4d)e4dqe)dre)d*e#e!eZf   fduZ^ edvddd%ddA      Z_dg d&g dwdfde#e!e_f   dpe#e!e_f   d(e4dxe+d)e4d*e#e!e_f   fdyZ`  edz       ejZ                  e`            Zade#e!e_f   dpe#e!e_f   d(e4dxe+d)e4d*e#e!e_f   fd{Zb ed|ddd%d      Zcdg d&g dwdfde#e!ecf   d}e#e!ejz                  f   dde#e!ecf   d(e4dxe+d)e4d*e#e!ecf   fd~Zd  ed       ejZ                  ed            Zede#e!ecf   d}e#e!ejz                  f   dde#e!ecf   d(e4dxe+d)e4d*e#e!ecf   fdZf edddd%d      ZgejN                  ejP                   ed      dg d&g dwdfde#e!egf   dpe#e!egf   dde#e!egf   d(e4dxe+d)e4d*e#e!egf   fd                     Zh  ed       ejZ                  eh            Ziehj^                  j`                  Zjde#e!egf   dpe#e!egf   dde#e!egf   d(e4dxe+d)e4d*e#e!egf   fdZk edddd%ddA      Zldg d&g dwdfde#e!ejz                  f   dpe#e!elf   dde#e!elf   d(e4dxe+d)e4d*e#e!elf   fdZm  ed       ejZ                  em            Znde#e!ejz                  f   dpe#e!elf   dde#e!elf   d(e4dxe+d)e4d*e#e!elf   fdZo edddd%ddA      ZpejN                  ejP                   ed      dg d&g dwdfde#e!epf   dpe#e!epf   dde#e!epf   d(e4dxe+d)e4d*e#e!epf   fd                     Zq  ed       ejZ                  eq            Zreqj^                  j`                  Zsde#e!epf   dpe#e!epf   dde#e!epf   d(e4dxe+d)e4d*e#e!epf   fdZt edddd%d      Zud/g ddfde#e!euf   dpe#e!euf   d(e4d)e4d*e#e!euf   f
dZv  ed       ejZ                  ev            Zwde#e!euf   dpe#e!euf   d(e4d)e4d*e#e!euf   f
dZx eddd%d      Zyg ddfde#e!eyf   dpe#e!eyf   dde#e!eyf   d(e4d*e#e!eyf   f
dZz  ed       ejZ                  ez            Z{de#e!eyf   dpe#e!eyf   dde#e!eyf   d(e4d*e#e!eyf   f
dZ| edddd%d      Z}ejN                  ejP                   eddg       edd      d/g ddfde#e!e}f   d}e#e!ejz                  f   dde#e!e}f   d(e4d)e4d*e#e!e}f   fd                            Z~  ed       ejZ                  e~            Ze~j^                  j`                  Zde#e!e}f   d}e#e!ejz                  f   dde#e!e}f   d(e4d)e4d*e#e!e}f   fdZ eddd%d      Zg ddfde#e!ef   dpe#e!ef   dde#e!ef   d(e4d*e#e!ef   f
dZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   dde#e!ef   d(e4d*e#e!ef   f
dZ edddd%d      Z eddAdB      Zd/g ddfde#e!ef   dpe#e!ef   dde#e!ef   d(e4d)e4d*e#e!ef   fdZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   dde#e!ef   d(e4d)e4d*e#e!ef   fdZ eddAdB      Zdde#e!ef   de4de4d*e#e!ef   fdZ  ed       ejZ                  e            Zde#e!ef   de4de4d*e#e!ef   fdZ eddAdB      Zdde#e!ef   de4de4d*e#e!ef   fdZ  ed       ejZ                  e            Zde#e!ef   de4de4d*e#e!ef   fdZ edddd%d      Zg d&g dwdfde#e!ef   dpe#e!ef   d(e4d)e4d*e#e!ef   f
dZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   d(e4d)e4d*e#e!ef   f
dZ edddd%d      Zg d&g dwdfde#e!ef   d}e#e!ejz                  f   dde#e!ef   d(e4d)e4d*e#e!ef   fdZ  ed       ejZ                  e            Zde#e!ef   d}e#e!ejz                  f   dde#e!ef   d(e4d)e4d*e#e!ef   fdZ edddd%d      Zg d&g dwdfde#e!ejz                  f   dpe#e!ef   dde#e!ef   d(e4d)e4d*e#e!ef   fdZ  ed       ejZ                  e            Zde#e!ejz                  f   dpe#e!ef   dde#e!ef   d(e4d)e4d*e#e!ef   fdZ edddd%dd@dAdBdCdIdJdKdL      Zdde#e!ef   dpe#e!ef   d(e4d*e#e!ef   fdZ  ed«       ejZ                  e            Zde#e!ef   dpe#e!ef   d(e4d*e#e!ef   fdÄZ edddd%dd@dAdBdCdIdJdKdL      Zdde#e!ef   dpe#e!ef   dde#e!ef   d(e4d*e#e!ef   f
dńZ  edƫ       ejZ                  e            Zde#e!ef   dpe#e!ef   dde#e!ef   d(e4d*e#e!ef   f
dǄZ edddd%dd@dAdBdCdIdJdKdL      Zdde#e!ef   dpe#e!ef   dde#e!ef   d(e4d*e#e!ef   f
dɄZ  edʫ       ejZ                  e            Zde#e!ef   dpe#e!ef   dde#e!ef   d(e4d*e#e!ef   f
d˄Z edddd%d      ZejN                  ejP                   edͫ      dde#e!ef   d*e#e!ef   fdτ                     Z  edЫ       ejZ                  e            Zej^                  j`                  Zde#e!ef   d*e#e!ef   fdфZ edddd%d      Zdde#e!ef   de#e!ef   d*e#e!ef   fdՄZ  ed֫       ejZ                  e            Zde#e!ef   de#e!ef   d*e#e!ef   fdׄZ ejH                  dg d٢      Z eddd%dAdB      Zdd'e#e!ef   de+de+de+de)de)fdZ  ed       ejZ                  e            Zd'e#e!ef   de+de+de+de)de)fdZ eddd%dAdB      Zdde#e!ejt                  f   dde#e!ef   de#e!ejt                  f   de#e!ejt                  f   de+d*e#e!ef   fdZ  ed       ejZ                  e            Zde#e!ejt                  f   dde#e!ef   de#e!ejt                  f   de#e!ejt                  f   de+d*e#e!ef   fdZ ejH                  dg d٢      Z eddd%dAdB      Zdd'e#e!ef   de+de+de+de)de)fdZ  ed       ejZ                  e            Zd'e#e!ef   de+de+de+de)de)fdZ eddd%dAdB      ZÐdde#e!ef   de#e!ef   dde#e!ef   de#e!ejt                  f   de#e!ejt                  f   de+d*e#e!ef   fdZ  ed       ejZ                  eī            Zde#e!ef   de#e!ef   dde#e!ef   de#e!ejt                  f   de#e!ejt                  f   de+d*e#e!ef   fdZ ejH                  dg d      Z edej                        Zɐdde#e!ef   de#e!ef   de#e!ef   de#e!ef   de#e!ef   de*de*d)e4d e+fdZ  ed       ejZ                  eʫ            Zde#e!ef   de#e!ef   de#e!ef   de#e!ef   de#e!ef   de*de*d)e4d e+fdZ ejH                  dg d      Z edej                        Zΐdde#e!ef   de#e!ef   de#e!ef   de#e!ef   d	e#e!ef   de*d)e4d e+fd
Z  ed       ejZ                  eϫ            ZАde#e!ef   de#e!ef   de#e!ef   de#e!ef   d	e#e!ef   de*d)e4d e+fdZ ejH                  dg d      Z edddd      Z edej                        ZԐdde#e!ef   de#e!ef   de#e!ej                  f   de#e!ef   d	e#e!ef   de*d)e4d e+fdZ  ed       ejZ                  eի            Z֐de#e!ef   de#e!ef   de#e!ej                  f   de#e!ef   d	e#e!ef   de*d)e4d e+fdZ ejH                  dg d      Z edddd      Z edej                        Zڐdde#e!ef   de#e!ef   de#e!ej                  f   de#e!ef   d	e#e!ef   de#e!ef   de*d)e4d e+fdZ  ed       ejZ                  e۫            Zܐde#e!ef   de#e!ef   de#e!ej                  f   de#e!ef   d	e#e!ef   de#e!ef   de*d)e4d e+fdZ ejH                  dg d      Z edddd      Z edej                        Zdde#e!ef   de#e!ef   de#e!ef   de#e!ef   de#e!ef   de*de*d)e4d e+fdZ  ed       ejZ                  e            Zde#e!ef   de#e!ef   de#e!ef   de#e!ef   de#e!ef   de*de*d)e4d e+fd Z ejH                  d!g d"      Z ed#ddd      Z ed$dd      Zdde#e!ef   de#e!ef   de#e!ef   de#e!ef   de#e!ef   de*de*d)e4d e+fd%Z  ed&       ejZ                  e            Zde#e!ef   de#e!ef   de#e!ef   de#e!ef   de#e!ef   de*de*d)e4d e+fd'Z ed(ddd%d      Zdde#e!ef   d)e#e!ejz                  f   dpe#e!ef   d*e4d(e4d*e#e!ef   fd+Z  ed,       ejZ                  e            Zde#e!ef   d)e#e!ejz                  f   dpe#e!ef   d*e4d(e4d*e#e!ef   fd-Z ed.dd%d      Zdde#e!ef   d/e#e!ejz                  f   d)e#e!ejz                  f   dpe#e!ef   d*e4d(e4d0e+d*e#e!ef   fd1Z  ed2       ejZ                  e            Zde#e!ef   d/e#e!ejz                  f   d)e#e!ejz                  f   dpe#e!ef   d*e4d(e4d0e+d*e#e!ef   fd3Z ed4dAdB      Zdd5e#e!ej                  f   d6e#e!ef   de)d*e#e!ej                  f   fd7Z  ed8       ejZ                  e            Zd5e#e!ej                  f   d6e#e!ef   de)d*e#e!ej                  f   fd9Z ed:dAdB      Zdd5e#e!ej                  f   d6e#e!ef   de#e!ef   d*e#e!ej                  f   fd;Z  ed<       ejZ                  e            Zd5e#e!ej                  f   d6e#e!ef   de#e!ef   d*e#e!ej                  f   fd=Z ejH                  d>d?d@g      Z edAddd%dd@dAdBdCdIdJdKdL      Z edBddd%d      Zej                  dfde#e!ef   dCefdDZ  edE       ejZ                  e            Z de#e!ef   dCefdFZ edGddd%d      ZejN                  ejP                   edH      ddMe#e!ef   d*e#e!ef   fdI                     Z  edJ       ejZ                  e            Zej^                  j`                  ZdMe#e!ef   d*e#e!ef   fdKZ edLddd      ZejN                  ejP                   edMdN      dde#e!ef   dOe)d_e*dPe*dPe*d*e#e!ef   fdQ                     Z  edR       ejZ                  e            Z	ej^                  j`                  Z
de#e!ef   dOe)d_e*dPe*dPe*d*e#e!ef   fdSZ edTddd      ZddUe#e!ef   dVe#e!ef   dWe#e!ef   dOe)d_e*dPe*dPe*d*e#e!ef   fdXZ  edY       ejZ                  e            ZdUe#e!ef   dVe#e!ef   dWe#e!ef   dOe)d_e*dPe*dPe*d*e#e!ef   fdZZ ed[ddd%d      Zdde#e!ef   dPe*d*e#e!ef   fd\Z  ed]       ejZ                  e            Zde#e!ef   dPe*d*e#e!ef   fd^Z ed_ddd%d      Zdde#e!ef   de#e!ef   dPe*d*e#e!ef   fd`Z  eda       ejZ                  e            Zde#e!ef   de#e!ef   dPe*d*e#e!ef   fdbZ edcddd%d      Zddde#e!ef   d*e#e!ef   fdeZ  edf       ejZ                  e            Zdde#e!ef   d*e#e!ef   fdgZ edhddd%dd@dAdBdCdFdIdL      Zg d&dfde#e!ef   d(e4d)e4d*e#e!ef   fdiZ  edj       ejZ                  e            Zde#e!ef   d(e4d)e4d*e#e!ef   fdkZ edlddd      Z dde#e!e f   d(e4d)e4d*e#e!e f   fdmZ!  edn       ejZ                  e!            Z"de#e!e f   d(e4d)e4d*e#e!e f   fdoZ# edpddd      Z$ edqddd      Z%dde#e!e%f   de#e!e%f   d5e#e!e$f   d(e4d)e4d*e#e!e$f   fdrZ&  eds       ejZ                  e&            Z'de#e!e%f   de#e!e%f   d5e#e!e$f   d(e4d)e4d*e#e!e$f   fdtZ( eduddd%dd@dAdBdCdIdJdKdL      Z)dde#e!e)f   de#e!e)f   d5e#e!e)f   d(e4d)e4d*e#e!e)f   fdvZ*  edw       ejZ                  e*            Z+de#e!e)f   de#e!e)f   d5e#e!e)f   d(e4d)e4d*e#e!e)f   fdxZ, edyddd%dd@dAdBdCdIdJdKdL      Z-g d&dfde#e!e-f   de#e!e-f   d5e#e!e-f   d(e4d)e4d*e#e!e-f   fdzZ.  ed{       ejZ                  e.            Z/de#e!e-f   de#e!e-f   d5e#e!e-f   d(e4d)e4d*e#e!e-f   fd|Z0 ed}ddd%dd@dAdBdCdIdJdKdL      Z1dde#e!e1f   de#e!e1f   d5e#e!e1f   d(e4d)e4d*e#e!e1f   fd~Z2  ed       ejZ                  e2            Z3de#e!e1f   de#e!e1f   d5e#e!e1f   d(e4d)e4d*e#e!e1f   fdZ4 edddd%dd@dAdBdCdIdJdKdL      Z5dde#e!e5f   de#e!e5f   d5e#e!e5f   de#e!ejz                  f   de#e!ejz                  f   d(e4d)e4d*e#e!e5f   fdZ6  ed       ejZ                  e6            Z7de#e!e5f   de#e!e5f   d5e#e!e5f   de#e!ejz                  f   de#e!ejz                  f   d(e4d)e4d*e#e!e5f   fdZ8 eddAdB      Z9 edddd%dd@dAdBdCdIdJdKdL      Z:dde#e!e:f   d5e#e!e:f   de#e!e9f   d(e4de+d*e#e!e:f   fdZ;  ed       ejZ                  e;            Z<de#e!e:f   d5e#e!e:f   de#e!e9f   d(e4de+d*e#e!e:f   fdZ= edddd%dd@dAdBdCdIdJdKdL      Z>dde#e!e>f   de#e!e>f   d5e#e!e>f   de#e!ejz                  f   de#e!ejz                  f   d(e4d)e4d*e#e!e>f   fdZ?  ed       ejZ                  e?            Z@de#e!e>f   de#e!e>f   d5e#e!e>f   de#e!ejz                  f   de#e!ejz                  f   d(e4d)e4d*e#e!e>f   fdZA eddAdB      ZB edddd%dd@dAdBdCdIdJdKdL      ZCdde#e!eCf   d5e#e!eCf   de#e!eBf   d(e4de+d*e#e!eCf   fdZD  ed       ejZ                  eD            ZEde#e!eCf   d5e#e!eCf   de#e!eBf   d(e4de+d*e#e!eCf   fdZF edddd%dd@dAdBdCdFdIdL      ZGdde#e!eGf   de#e!ejz                  f   de#e!ejz                  f   d(e4d)e4d*e#e!eGf   fdZH  ed       ejZ                  eH            ZIde#e!eGf   de#e!ejz                  f   de#e!ejz                  f   d(e4d)e4d*e#e!eGf   fdZJ ejH                  dd?dg      ZK eddAdB      ZL edddd%dd@dAdBdCdIdJdKdL      ZMej                  ddfde#e!eMf   d(e4deLde+fdZO  ed       ejZ                  eO            ZPde#e!eMf   d(e4deLde+fdZQ edddd%dd@dAdBdCdIdJdKdL      ZRdde#e!eRf   de#e!ejz                  f   de+d*e#e!eRf   fdZS  ed       ejZ                  eS            ZTde#e!eRf   de#e!ejz                  f   de+d*e#e!eRf   fdZU ejH                  dg d      ZV eddDdEdFdGdH      ZWdde#e!eWf   de#e!ej                  f   de#e!ej                  f   d(e4fdZX  ed       ejZ                  eX            ZYde#e!eWf   de#e!ej                  f   de#e!ej                  f   d(e4fdZZ ejH                  dg d      Z[ eddDdEdFdGdH      Z\ eddDdEdFdGdH      Z]ddMe#e!e\f   de#e!ej                  f   de#e!ej                  f   dNe#e!e\f   de#e!ej                  f   de#e!ej                  f   dOe#e!e\f   de#e!ej                  f   de#e!ej                  f   dPe#e!e\f   de#e!ej                  f   de#e!ej                  f   dQe#e!e\f   de#e!ej                  f   de#e!ej                  f   de]dRe*dSe+f$dZ^  ed       ejZ                  e^            Z_dMe#e!e\f   de#e!ej                  f   de#e!ej                  f   dNe#e!e\f   de#e!ej                  f   de#e!ej                  f   dOe#e!e\f   de#e!ej                  f   de#e!ej                  f   dPe#e!e\f   de#e!ej                  f   de#e!ej                  f   dQe#e!e\f   de#e!ej                  f   de#e!ej                  f   de]dRe*dSe+f$dZ` ejH                  dg dâ      Za eddDdEdFdGdH      Zb eddDdEdFdGdH      Zc eddDdEdFdGdH      Zddde#e!ebf   d_e#e!ecf   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   dedfdɄZe  edʫ       ejZ                  ee            Zfde#e!ebf   d_e#e!ecf   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   dedfd˄Zg ejH                  dg d      Zh eddDdEdFdGdH      Zi eddDdEdFdGdH      Zj eddDdEdFdGdH      Zkej                  g dwdfde#e!eif   dpe#e!ejf   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4dekfd҄Zm  edӫ       ejZ                  em            Znde#e!eif   dpe#e!ejf   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4dekfdԄZo ejH                  dg d      Zp eddDdEdFdGdH      Zq eddDdEdFdGdH      Zr eddDdEdFdGdH      Zsej                  g dwg dfde#e!eqf   dpe#e!erf   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4desfdلZt  edګ       ejZ                  et            Zude#e!eqf   dpe#e!erf   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4desfdۄZv ejH                  dg d      Zw eddDdEdFdGdH      Zx eddDdEdFdGdH      Zy eddDdEdFdGdH      Zzej                  g dwg dfde#e!exf   dpe#e!eyf   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4dezfdZ|  ed       ejZ                  e|            Z}de#e!exf   dpe#e!eyf   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4dezfdZ~ ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Zej                  g dwdfde#e!ef   dpe#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defd Z ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Z edddE      Z eddDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ ejH                  d	g d      Z ed
dDdEdFdGdH      Z eddDdEdFdGdH      Z edddE      Z eddDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdZ ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Z edddE      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ef   de#e!ej                  f   de#e!ej                  f   d(e4defdZ  ed       ejZ                  e            Zde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ef   de#e!ej                  f   de#e!ej                  f   d(e4defdZ ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Z ed dDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defd!Z  ed"       ejZ                  e            Zde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defd#Z ejH                  d$g d      Z ed%dDdEdFdGdH      Z ed&dDdEdFdGdH      Z ed'ddE      Z ed(dDdEdFdGdH      Z ed)dDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ef   de#e!ej                  f   de#e!ej                  f   d(e4defd*Z  ed+       ejZ                  e«            Zde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ef   de#e!ej                  f   de#e!ej                  f   d(e4defd,Z ejH                  d-g d      Z ed.dDdEdFdGdH      Z ed/dDdEdFdGdH      Z ed0dDdEdFdGdH      Zej                  g dwdfde#e!ef   dpe#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defd1Z  ed2       ejZ                  eɫ            Zde#e!ef   dpe#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defd3Z ejH                  d4g d      Z ed5dDdEdFdGdH      Z ed6dDdEdFdGdH      Z ed7dDdEdFdGdH      Zej                  g dwdfde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defd8Z  ed9       ejZ                  eЫ            Zde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defd:Z ejH                  d;g d      Z ed<dDdEdFdGdH      Z ed=dDdEdFdGdH      Z ed>dDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defd?Z  ed@       ejZ                  e׫            Zde#e!ef   dpe#e!ef   d_e#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdAZ ejH                  dBg d      Z edCdDdEdFdGdH      Z edDdDdEdFdGdH      Z edEddE      Z edFdDdEdFdGdH      Zej                  g dwg dfde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdGZ  edH       ejZ                  e߫            Zde#e!ef   dpe#e!ef   d_e#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   d(e4defdIZ ejH                  dJg dK      Z edLdDdEdFdGdH      Z edMdDdEdFdGdH      Z edNddE      Z edOdDdEdFdGdH      Zej                  ddېdPdfdQe#e!ef   dRe#e!ef   d_e#e!ef   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   dWedXe+dYe+dZe4fd[Z  ed\       ejZ                  e            ZdQe#e!ef   dRe#e!ef   d_e#e!ef   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   dWedXe+dYe+dZe4fd]Z ed^dDdEdFdGdH      Z ed_dDdEdFdGdH      Z ed`ddE      Z edaej                        ZddQe#e!ef   dRe#e!ef   d_e#e!ef   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   de#e!ej                  f   de#e!ej                  f   dWedXe+dYe+dZe4d*e#e!ef   fdbZ  edc       ejZ                  e            ZdQe#e!ef   dRe#e!ef   d_e#e!ef   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   de#e!ej                  f   de#e!ej                  f   dWedXe+dYe+dZe4d*e#e!ef   fddZ ejH                  deg dK      Z edfdDdEdFdGdH      Z edgdDdEdFdGdH      Z edhdDdEdFdGdH      Zej                  ddېdPdfdQe#e!ef   dRe#e!ef   d_e#e!ej                  f   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   dWedXe+dYe+dZe4fdiZ  edj       ejZ                  e            ZdQe#e!ef   dRe#e!ef   d_e#e!ej                  f   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   dWedXe+dYe+dZe4fdkZ ejH                  dlg dK      Z edmdDdEdFdGdH      Z edndDdEdFdGdH      Z edoddE      Z edpdDdEdFdGdH      Zej                  ddېdPdfdQe#e!ef   dRe#e!ef   d_e#e!ef   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   de#e!ej                  f   de#e!ej                  f   dWedXe+dYe+dZe4fdqZ  edr       ejZ                  e            ZdQe#e!ef   dRe#e!ef   d_e#e!ef   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   de#e!ej                  f   de#e!ej                  f   dWedXe+dYe+dZe4fdsZ ejH                  dtg dK      Z  edudDdEdFdGdH      Z edvdDdEdFdGdH      Z edwddE      Z edxdDdEdFdGdH      Zej                  ddېdPdfdQe#e!ef   dRe#e!ef   d_e#e!ef   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   de#e!ej                  f   de#e!ej                  f   dWedXe+dYe+dZe4fdyZ  edz       ejZ                  e            ZdQe#e!ef   dRe#e!ef   d_e#e!ef   dSe#e!ej                  f   dTe#e!ej                  f   dUe#e!ej                  f   dVe#e!ej                  f   de#e!ej                  f   de#e!ej                  f   dWedXe+dYe+dZe4fd{Z ejH                  d|g d      Z ed}dDdEdFdGdH      Z	dde#e!e	f   de#e!ej                  f   de#e!ej                  f   d(e4fd~Z
  ed       ejZ                  e
            Zde#e!e	f   de#e!ej                  f   de#e!ej                  f   d(e4fdZ ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Zej                  dfde#e!ef   de#e!ej                  f   de#e!ej                  f   defdZ  ed       ejZ                  e            Zde#e!ef   de#e!ej                  f   de#e!ej                  f   defdZ ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Zej                  dfde#e!ef   de#e!ej                  f   de#e!ej                  f   defdZ  ed       ejZ                  e            Zde#e!ef   de#e!ej                  f   de#e!ej                  f   defdZ ejH                  dg d      Z eddDdEdFdGdH      Z eddDdEdFdGdH      Zej                  dfde#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   def
dZ  ed       ejZ                  e            Zde#e!ef   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   def
dZ edddd%dd@dAdBdCdFdIdJdKdL      ZejN                  ejP                   ed      dde#e!ef   d*e#e!ef   fd                     Z   ed       ejZ                  e             Z!e j^                  j`                  Z"de#e!ef   d*e#e!ef   fdZ# edddd%dd@dAdBdCdIdJdKdL      Z$dde#e!e$f   d*e#e!e$f   fdZ%  ed       ejZ                  e%            Z&de#e!e$f   d*e#e!e$f   fdZ' edddd%dd@dAdBdCdIdJdKdL      Z(dde#e!e(f   de#e!e(f   d*e#e!e(f   fdZ)  ed       ejZ                  e)            Z*de#e!e(f   de#e!e(f   d*e#e!e(f   fdZ+ edddd%dd@dAdBdCdIdJdKdL      Z,dde#e!e,f   de#e!e,f   d*e#e!e,f   fdZ-  ed       ejZ                  e-            Z.de#e!e,f   de#e!e,f   d*e#e!e,f   fdZ/ edddd%d      Z0ejN                  ejP                   ed      dde#e!e0f   d*e#e!e0f   fd                     Z1  ed       ejZ                  e1            Z2e1j^                  j`                  Z3de#e!e0f   d*e#e!e0f   fdZ4 edddd%d      Z5dde#e!e5f   de#e!e5f   d*e#e!e5f   fdZ6  ed       ejZ                  e6            Z7de#e!e5f   de#e!e5f   d*e#e!e5f   fdZ8 edddd%d      Z9ddde#e!e9f   d*e#e!e9f   fdZ:  ed       ejZ                  e:            Z;dde#e!e9f   d*e#e!e9f   fdZ< ejH                  dddZg      Z= edddd%d      Z>dde#e!e>f   de#e!e>f   fdZ?  ed       ejZ                  e?            Z@de#e!e>f   de#e!e>f   fdZA edddd%d      ZBdde#e!eBf   d*e#e!eBf   fdZC  ed       ejZ                  eC            ZDde#e!eBf   d*e#e!eBf   fdZE edddd%d      ZFdde#e!eFf   de#e!eFf   d*e#e!eFf   fdZG  ed«       ejZ                  eG            ZHde#e!eFf   de#e!eFf   d*e#e!eFf   fdÄZI edddd%d      ZJejN                  ejP                   edŐdƫ      dde#e!eJf   d*e#e!eJf   fdǄ                     ZK  edȫ       ejZ                  eK            ZLeKj^                  j`                  ZMde#e!eJf   d*e#e!eJf   fdɄZN edddd%d      ZOdde#e!eOf   de#e!eOf   d*e#e!eOf   fd˄ZP  ed̫       ejZ                  eP            ZQde#e!eOf   de#e!eOf   d*e#e!eOf   fd̈́ZR ejH                  dΐddZg      ZS edddd%d      ZT eddAdB      ZUdde#e!eTf   de#e!eUf   fdфZV  edҫ       ejZ                  eV            ZWde#e!eTf   de#e!eUf   fdӄZX ejH                  dddg      ZY edddd%dd@dAdBdCdIdJdKdL      ZZdde#e!eZf   de)de+fdׄZ[  edث       ejZ                  e[            Z\de#e!eZf   de)de+fdلZ] ejH                  dddg      Z^ edddd%dd@dAdBdCdIdJdKdL      Z_ edd@dAdB      Z` edd@dAdB      Zadej                  dfde#e!e_f   de#e!e`f   de+dސeafd߄Zc  ed       ejZ                  ec            Zdde#e!e_f   de#e!e`f   de+dސeafdZey(  zUPython wrappers around TensorFlow ops.

This file is MACHINE GENERATED! Do not edit.
    N)
pywrap_tfe)context)core)execute)dtypes)annotation_types)op_def_registry)ops)op_def_library)deprecated_endpoints)dispatch)	tf_export)TypeVarListAny)	Annotated
ApproxTopKvaluesindicesTV_ApproxTopK_Tz_atypes.BFloat16z_atypes.Float32z_atypes.Halfapprox_top_kTinputkreduction_dimensionrecall_targetis_max_kreduction_input_size_overrideaggregate_to_topkc                    t         j                   xs t        j                         }|j                  }	|	j                  r<	 t	        j
                  |d|| d|d|d|d|d|d|      }
t        j                  |
      }
|
S t        | |||||||fd      }
|
t        ur|
S t3        j4                  |d      }|d}t3        j4                  |d      }|d}t3        j6                  |d      }|d}t3        j8                  |d      }|d}t3        j4                  |d      }|d}t3        j8                  |d      }	 t;        j<                  d| |||||||	      \  }}}}|dd }
t3        j>                         rd|jA                  d      d|jA                  d      d|jC                  d      d|jE                  d      d|jA                  d      d|jE                  d      d|jG                  d      f}|jH                  }t3        jJ                  d|||
       t        j                  |
      }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||fd      }
|
t        ur|
S t        | ||||||||		      S # t        j                   $ r Y t"        t$        f$ rN t'        j(                  t*        d
t-        | |||||||            }
|
t&        j.                  j0                  ur|
cY S  w xY w# t"        t$        f$ rN t'        j(                  t*        d
t-        | |||||||            }
|
t&        j.                  j0                  ur|
cY S  w xY w)a  Returns min/max k values and their indices of the input operand in an approximate manner.

  See https://arxiv.org/abs/2206.14286 for the algorithm details.
  This op is only optimized on TPU currently.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      Array to search. Must be at least 1-D of the floating type
    k: An `int` that is `>= 0`. Specifies the number of min/max-k.
    reduction_dimension: An optional `int`. Defaults to `-1`.
      Integer dimension along which to search. Default: -1.
    recall_target: An optional `float`. Defaults to `0.95`.
      Recall target for the approximation. Range in (0,1]
    is_max_k: An optional `bool`. Defaults to `True`.
      When true, computes max-k; otherwise computes min-k.
    reduction_input_size_override: An optional `int`. Defaults to `-1`.
      When set to a positive value, it overrides the size determined by
      `input[reduction_dim]` for evaluating the recall. This option is useful when
      the given `input` is only a subset of the overall computation in SPMD or
      distributed pipelines, where the true input size cannot be deferred by the
      `input` shape.
    aggregate_to_topk: An optional `bool`. Defaults to `True`.
      When true, aggregates approximate results to top-k. When false, returns the
      approximate results. The number of the approximate results is implementation
      defined and is greater equals to the specified `k`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (values, indices).

    values: A `Tensor`. Has the same type as `input`.
    indices: A `Tensor` of type `int32`.
  r   r   r   r   r   r   r   N)r   r   r   r   r   r   namectx )r   r   r   r   r   r   r   r    ffffff?TT)&_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_ApproxTopKOutput_make_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackException_dispatcher_for_approx_top_kNotImplementedapprox_top_k_eager_fallback_SymbolicException	TypeError
ValueError	_dispatchr   r   dictOpDispatcherNOT_SUPPORTED_executemake_int
make_float	make_bool_op_def_library_apply_op_helpermust_record_gradient_get_attr_intget_attr_get_attr_bool_get_attr_typeinputsrecord_gradient)r   r   r   r   r   r   r   r    _ctxtld_resulte__op_outputs_attrs_inputs_flats                    P/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/gen_nn_ops.pyr   r      s   J 
			0h..0$#\\11lD%a1F_mZ1%':<M	Og
 "''0gn@ +	&x%'8$	ABFHG n$n3!  ))*=?TUM%%m_E-H*5("*$&!"*"3"34QSr"s(():<OP
)::EQ*=$1H4Q(9FAq#x& QK'""$3$$S)+@ 56ll?+Z  ,.M ?@!3#5#56I#J3%%c*,F ::LlFG5##G,'	.m && -
##At,,## 
,!(-
'):DCDHJg 
	&(
1*=%(E-Dd	D D
 ## 
z" """d!7J1>,4A^5F(,.g 
	..<<	<V Z	  
  
Du5H/<*2?\3D&*,
G i,,:::n	
sP    :H" 2#L "I)5II)(I)-J J L5ALLAM1/M1zraw_ops.ApproxTopKc	                    t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d	      }t        j                  | g|t
        j                  t
        j                  t
        j                  g      \  }	\  } | g}
d|d|d|d|d|d	|d
|	f}t        j                  dd|
|||      }t        j                         rt        j                  d|
||       t        j                  |      }|S )Nr   r#   r   r$   r   Tr   r   r   r%   s
   ApproxTopK   rF   attrsr!   r    r   )r;   r<   r=   r>   args_to_matching_eager_dtypeshalfbfloat16float32r   rA   rG   r*   r+   )r   r   r   r   r   r   r   r    r!   _attr_TrP   rO   rJ   s                rQ   r3   r3      sp   3!  ))*=?TUM%%m_E-H*5("*$&!"*"3"34QSr"s(():<OP55ugsW\\SZScSceletetDwx'8E,)+>=*h!#@(#w8& ]Al#)s?'""$lFG5##G,'	.    TV_AvgPool_Tz_atypes.Float64NHWCvaluepaddingdata_formatreturnc                    t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| d|d|d|d|      }|S t        |t        t        f      st!        d|z        |D 
cg c]  }
t#        j$                  |
d       }}
t        |t        t        f      st!        d	|z        |D 
cg c]  }
t#        j$                  |
d       }}
t#        j&                  |d      }|d
}t#        j&                  |d      }t)        j*                  d| |||||      \  }}}}|dd }t#        j,                         r{d|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t#        j4                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y w xY wc c}
w c c}
w )aw  Performs average pooling on the input.

  Each entry in `output` is the mean of the corresponding size `ksize`
  window in `value`.

  Args:
    value: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      4-D with shape `[batch, height, width, channels]`.
    ksize: A list of `ints` that has length `>= 4`.
      The size of the sliding window for each dimension of `value`.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of `value`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `value`.
  AvgPoolksizestridesr`   ra   Nre   rf   r`   ra   r    r!   <Expected list for 'ksize' argument to 'avg_pool' Op, not %r.>Expected list for 'strides' argument to 'avg_pool' Op, not %r.r^   )r_   re   rf   r`   ra   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   avg_pool_eager_fallbackr4   
isinstancelisttupler5   r;   r<   make_strr?   r@   rA   rC   rE   rF   rG   )r_   re   rf   r`   ra   r    rH   rI   rJ   rK   _irL   rM   rN   rO   rP   s                   rQ   avg_poolrp      sj   4 
			0h..0$#\\11iugui7M;8g n 
ED%=	)
	!#(	)* * 5:
:b8R)
:%
:	GdE]	+
	!#*	+, , 9@@"Xr9-@'@gy1'K!!+}=+'88eWg*7!QX QK'""$s||G,ill9%y#,,y2IS\\-8#  %'F ::L<2('	.M && -
##At,,## 
$
ugw!$8 8 ## 
 ;
 A<    !G 
IIH".H		H"!H"&H8 8IIzraw_ops.AvgPoolc           
         t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }t	        j                  | g|t        j                  t        j                  t        j                  t        j                  g      \  }\  } | g}	d|d|d|d|d|f
}
t	        j                  d	d
|	|
||      }t	        j                         rt	        j                  d|	|
|       |\  }|S c c}w c c}w )Nrh   re   ri   rf   r`   r^   ra   r%   s   AvgPool   rT   rd   rk   rl   rm   r5   r;   r<   rn   rV   rW   rX   rY   rZ   float64r   rA   rG   )r_   re   rf   r`   ra   r    r!   ro   r[   rP   rO   rJ   s               rQ   rj   rj     s   	ED%=	)
	!#(	)* * 5:
:b8R)
:%
:	GdE]	+
	!#*	+, , 9@@"Xr9-@'@gy1'K!!+}=+55ugsW\\SZScSceletetv}  wF  wF  EI  J'8E,UIw	7c7,&Z<v!$41'""$<2('	.) ;
 A   E40E9TV_AvgPool3D_TNDHWCc                    t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| d|d|d|d|      }|S t        |t        t        f      st!        d|z        |D 
cg c]  }
t#        j$                  |
d       }}
t        |t        t        f      st!        d	|z        |D 
cg c]  }
t#        j$                  |
d       }}
t#        j&                  |d      }|d
}t#        j&                  |d      }t)        j*                  d| |||||      \  }}}}|dd }t#        j,                         r{d|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t#        j4                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y w xY wc c}
w c c}
w )a%  Performs 3D average pooling on the input.

  Each entry in `output` is the mean of the corresponding size `ksize` window in
  `value`.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      Shape `[batch, depth, rows, cols, channels]` tensor to pool over.
    ksize: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The size of the window for each dimension of
      the input tensor. Must have `ksize[0] = ksize[4] = 1`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NDHWC", "NCDHW"`. Defaults to `"NDHWC"`.
      The data format of the input and output data. With the
      default format "NDHWC", the data is stored in the order of:
          [batch, in_depth, in_height, in_width, in_channels].
      Alternatively, the format could be "NCDHW", the data storage order is:
          [batch, in_channels, in_depth, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  	AvgPool3Dre   rf   r`   ra   Nrg   >Expected list for 'ksize' argument to 'avg_pool3d' Op, not %r.@Expected list for 'strides' argument to 'avg_pool3d' Op, not %r.rx   r   re   rf   r`   ra   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   avg_pool3d_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rC   rE   rF   rG   r   re   rf   r`   ra   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                   rQ   
avg_pool3dr   8  sk   8 
			0h..0$#\\11k4	77M;8g n 
ED%=	)
	#%*	+, , 5:
:b8R)
:%
:	GdE]	+
	#%,	-. . 9@@"Xr9-@'@gy1'K!!+}=+'885w$+DJ!QX QK'""$s||G,ill9%y#,,y2IS\\-8#  %'F ::L\674('	.M && -
##At,,## 
&
ugw!$8 8 ## 
 ;
 Arq   zraw_ops.AvgPool3Dc           
         t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }t	        j                  | g|t        j                  t        j                  t        j                  t        j                  g      \  }\  } | g}	d|d|d|d|d|f
}
t	        j                  d	d
|	|
||      }t	        j                         rt	        j                  d|	|
|       |\  }|S c c}w c c}w )Nr{   re   r|   rf   r`   rx   ra   r%   s	   AvgPool3Drs   rT   rz   rt   r   re   rf   r`   ra   r    r!   ro   r[   rP   rO   rJ   s               rQ   r~   r~     s   	ED%=	)
	#%*	+, , 5:
:b8R)
:%
:	GdE]	+
	#%,	-. . 9@@"Xr9-@'@gy1'K!!+}=+55ugsW\\SZScSceletetv}  wF  wF  EI  J'8E,UIw	7c7,&\1\#)s?'""$\674('	.) ;
 Arv   TV_AvgPool3DGrad_Torig_input_shapegradc                    t         j                   xs t        j                         }|j                  }|j                  r$	 t	        j
                  |d|| |d|d|d|d|      }	|	S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d
}t#        j&                  |d      }t)        j*                  d| ||||||      \  }}}}|dd }	t#        j,                         r{d|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t#        j4                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w c c}w )a"  Computes gradients of average pooling function.

  Args:
    orig_input_shape: A `Tensor` of type `int32`.
      The original input dimensions.
    grad: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      Output backprop of shape `[batch, depth, rows, cols, channels]`.
    ksize: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The size of the window for each dimension of
      the input tensor. Must have `ksize[0] = ksize[4] = 1`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NDHWC", "NCDHW"`. Defaults to `"NDHWC"`.
      The data format of the input and output data. With the
      default format "NDHWC", the data is stored in the order of:
          [batch, in_depth, in_height, in_width, in_channels].
      Alternatively, the format could be "NCDHW", the data storage order is:
          [batch, in_channels, in_depth, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `grad`.
  AvgPool3DGradre   rf   r`   ra   Nrg   CExpected list for 'ksize' argument to 'avg_pool3d_grad' Op, not %r.EExpected list for 'strides' argument to 'avg_pool3d_grad' Op, not %r.rx   r   r   re   rf   r`   ra   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   avg_pool3d_grad_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rC   rE   rF   rG   r   r   re   rf   r`   ra   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                    rQ   avg_pool3d_gradr     sv   6 
			0h..0$#\\11ot%5tWe7Iw{Lg n 
ED%=	)
	(*/	01 1 5:
:b8R)
:%
:	GdE]	+
	(*1	23 3 9@@"Xr9-@'@gy1'K!!+}=+'88*:$gw%0t=!QX QK'""$s||G,ill9%y#,,y2IS\\-8#  %'F ::Lvw8('	.O && -
##At,,## 
+
Dw{4I I ## 
 ;
 A<    "G IIH$0HH$#H$(H; ;IIzraw_ops.AvgPool3DGradc           
      F   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }t	        j                  |g|t        j                  t        j                  t        j                  t        j                  g      \  }	\  }t        j                  | t        j                        } | |g}
d|d|d|d|d|	f
}t	        j                   d	d
|
|||      }t	        j"                         rt	        j$                  d|
||       |\  }|S c c}w c c}w )Nr   re   r   rf   r`   rx   ra   r%   s   AvgPool3DGradrs   rT   r   rk   rl   rm   r5   r;   r<   rn   rV   rW   rX   rY   rZ   ru   r.   convert_to_tensorint32r   rA   rG   r   r   re   rf   r`   ra   r    r!   ro   r[   rP   rO   rJ   s                rQ   r   r     s   	ED%=	)
	(*/	01 1 5:
:b8R)
:%
:	GdE]	+
	(*1	23 3 9@@"Xr9-@'@gy1'K!!+}=+44dVS7<<QXQaQacjcrcrt{  uD  uD  CG  H'7D++,<gmmL"D),UIw	7c7,&-q#)s?'""$vw8('	.+ ;
 A   F0FTV_AvgPoolGrad_Tc                    t         j                   xs t        j                         }|j                  }|j                  r$	 t	        j
                  |d|| |d|d|d|d|      }	|	S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d
}t#        j&                  |d      }t)        j*                  d| ||||||      \  }}}}|dd }	t#        j,                         r{d|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t#        j4                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w c c}w )a  Computes gradients of the average pooling function.

  Args:
    orig_input_shape: A `Tensor` of type `int32`.
      1-D.  Shape of the original input to `avg_pool`.
    grad: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      4-D with shape `[batch, height, width, channels]`.  Gradients w.r.t.
      the output of `avg_pool`.
    ksize: A list of `ints` that has length `>= 4`.
      The size of the sliding window for each dimension of the input.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of the input.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `grad`.
  AvgPoolGradre   rf   r`   ra   Nrg   AExpected list for 'ksize' argument to 'avg_pool_grad' Op, not %r.CExpected list for 'strides' argument to 'avg_pool_grad' Op, not %r.r^   r   r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   avg_pool_grad_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rC   rE   rF   rG   r   s                    rQ   avg_pool_gradr     sv   4 
			0h..0$#\\11mT#3T7E7Iw{Lg n 
ED%=	)
	&(-	./ / 5:
:b8R)
:%
:	GdE]	+
	&(/	01 1 9@@"Xr9-@'@gy1'K!!+}=+'88(8t"GW#.T;!QX QK'""$s||G,ill9%y#,,y2IS\\-8#  %'F ::L|VW6('	.O && -
##At,,## 
)
Dw{4I I ## 
 ;
 Ar   zraw_ops.AvgPoolGradc           
      F   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }t	        j                  |g|t        j                  t        j                  t        j                  t        j                  g      \  }	\  }t        j                  | t        j                        } | |g}
d|d|d|d|d|	f
}t	        j                   d	d
|
|||      }t	        j"                         rt	        j$                  d|
||       |\  }|S c c}w c c}w )Nr   re   r   rf   r`   r^   ra   r%   s   AvgPoolGradrs   rT   r   r   r   s                rQ   r   r   a  s   	ED%=	)
	&(-	./ / 5:
:b8R)
:%
:	GdE]	+
	&(/	01 1 9@@"Xr9-@'@gy1'K!!+}=+44dVS7<<QXQaQacjcrcrt{  uD  uD  CG  H'7D++,<gmmL"D),UIw	7c7,&^Q|#)s?'""$|VW6('	.+ ;
 Ar   %TV_BatchNormWithGlobalNormalization_Tz_atypes.Complex128z_atypes.Complex64z_atypes.Int16z_atypes.Int32z_atypes.Int64z_atypes.Int8z_atypes.QInt16z_atypes.QInt32z_atypes.QInt8z_atypes.QUInt16z_atypes.QUInt8z_atypes.UInt16z_atypes.UInt32z_atypes.UInt64z_atypes.UInt8tmvbetagammavariance_epsilonscale_after_normalizationc                 D   t         j                   xs t        j                         }|j                  }	|	j                  r#	 t	        j
                  |d|| ||||d|d|      }
|
S t        j                  |d      }t        j                  |d      }t!        j"                  d| |||||||	      \  }}}}|dd }
t        j$                         rYd|j'                  d      d|j)                  d      d|j+                  d      f}|j,                  }t        j.                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y <w xY w)a  Batch normalization.

  This op is deprecated. Prefer `tf.nn.batch_normalization`.

  Args:
    t: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`.
      A 4D input Tensor.
    m: A `Tensor`. Must have the same type as `t`.
      A 1D mean Tensor with size matching the last dimension of t.
      This is the first output from tf.nn.moments,
      or a saved moving average thereof.
    v: A `Tensor`. Must have the same type as `t`.
      A 1D variance Tensor with size matching the last dimension of t.
      This is the second output from tf.nn.moments,
      or a saved moving average thereof.
    beta: A `Tensor`. Must have the same type as `t`.
      A 1D beta Tensor with size matching the last dimension of t.
      An offset to be added to the normalized tensor.
    gamma: A `Tensor`. Must have the same type as `t`.
      A 1D gamma Tensor with size matching the last dimension of t.
      If "scale_after_normalization" is true, this tensor will be multiplied
      with the normalized tensor.
    variance_epsilon: A `float`. A small float number to avoid dividing by 0.
    scale_after_normalization: A `bool`.
      A bool indicating whether the resulted tensor
      needs to be multiplied with gamma.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `t`.
   BatchNormWithGlobalNormalizationr   r   Nr   r   r    r!   )r   r   r   r   r   r   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   4_batch_norm_with_global_normalization_eager_fallbackr4   r;   r=   r>   r?   r@   rA   rE   rC   rD   rF   rG   )r   r   r   r   r   r   r   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                    rQ   %_batch_norm_with_global_normalizationr     s   @ 
			0h..0$#\\	110$1au,.I!#g n (()9;MN&001JLgh'88*a127=MF_157!QX QK'""$3%%c*,>ll-.0K  !<=?F ::L*L&'K('	.; && -
##At,,## 
A
Q41A$=D  ## 
s0    !D) )E0<EE0/E04F FFz(raw_ops.BatchNormWithGlobalNormalizationc	                    t        j                  |d      }t        j                  |d      }t        j                  | ||||g|t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  t        j*                  t        j,                  t        j.                  g      \  }	}
|
\  } }}}}| ||||g}d|	d|d|f}t        j0                  dd||||      }t        j2                         rt        j4                  d|||       |\  }|S )Nr   r   r%   s    BatchNormWithGlobalNormalizationrs   rT   r   )r;   r=   r>   rV   rW   rZ   ru   r   uint8int16int8	complex64int64qint8quint8qint32rY   qint16quint16uint16
complex128rX   uint32uint64r   rA   rG   )r   r   r   r   r   r   r   r    r!   r[   	_inputs_TrP   rO   rJ   s                 rQ   r   r     sT   (()9;MN&001JLgh661au7MsU\UdUdfmfufuw~  xE  xE  GN  GT  GT  V]  Vc  Vc  el  eq  eq  sz  sD  sD  FM  FS  FS  U\  Ub  Ub  dk  dr  dr  t{  tB  tB  DK  DT  DT  V]  Vd  Vd  fm  fu  fu  w~  wE  wE  GN  GY  GY  [b  [g  [g  ip  iw  iw  y@  yG  yG  UJ  K'9$1aD%Q4',,.>8:&@!$0C"&(' ""$*L&'K('	.r\   $BatchNormWithGlobalNormalizationGrad)dxdmdvdbdg)TV_BatchNormWithGlobalNormalizationGrad_Tbackpropc                    t         j                   xs t        j                         }|j                  }	|	j                  r8	 t	        j
                  |d|| ||||d|d|      }
t        j                  |
      }
|
S t        j                   |d      }t        j"                  |d      }t%        j&                  d| |||||||	      \  }}}}|dd }
t        j(                         rYd|j+                  d      d|j-                  d      d|j/                  d      f}|j0                  }t        j2                  d|||
       t        j                  |
      }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y Mw xY w)a  Gradients for batch normalization.

  This op is deprecated. See `tf.nn.batch_normalization`.

  Args:
    t: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`.
      A 4D input Tensor.
    m: A `Tensor`. Must have the same type as `t`.
      A 1D mean Tensor with size matching the last dimension of t.
      This is the first output from tf.nn.moments,
      or a saved moving average thereof.
    v: A `Tensor`. Must have the same type as `t`.
      A 1D variance Tensor with size matching the last dimension of t.
      This is the second output from tf.nn.moments,
      or a saved moving average thereof.
    gamma: A `Tensor`. Must have the same type as `t`.
      A 1D gamma Tensor with size matching the last dimension of t.
      If "scale_after_normalization" is true, this Tensor will be multiplied
      with the normalized Tensor.
    backprop: A `Tensor`. Must have the same type as `t`. 4D backprop Tensor.
    variance_epsilon: A `float`. A small float number to avoid dividing by 0.
    scale_after_normalization: A `bool`.
      A bool indicating whether the resulted tensor
      needs to be multiplied with gamma.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (dx, dm, dv, db, dg).

    dx: A `Tensor`. Has the same type as `t`.
    dm: A `Tensor`. Has the same type as `t`.
    dv: A `Tensor`. Has the same type as `t`.
    db: A `Tensor`. Has the same type as `t`.
    dg: A `Tensor`. Has the same type as `t`.
  r   r   r   Nr   )r   r   r   r   r   r   r   r    r%   )r&   r   r'   r(   r   r)   +_BatchNormWithGlobalNormalizationGradOutputr+   r,   r-   r.   r/   r0   8batch_norm_with_global_normalization_grad_eager_fallbackr4   r;   r=   r>   r?   r@   rA   rE   rC   rD   rF   rG   )r   r   r   r   r   r   r   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                    rQ   )batch_norm_with_global_normalization_gradr     s   H 
			0h..0$#\\
114dAq!U$&6#%>@g <AA'Jgn (()9;MN&001JLgh'88.!qAU9AAQJc59;!QX QK'""$3%%c*,>ll-.0K  !<=?F ::L.fgO7==gF'	.; && -
##At,,## 
E
Q5(5E$=D  ## 
s0    6E F"E==FFF. .GGz,raw_ops.BatchNormWithGlobalNormalizationGradc	                    t        j                  |d      }t        j                  |d      }t        j                  | ||||g|t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  t        j*                  t        j,                  t        j.                  g      \  }	}
|
\  } }}}}| ||||g}d|	d|d|f}t        j0                  dd||||      }t        j2                         rt        j4                  d|||       t6        j9                  |      }|S )Nr   r   r%   s$   BatchNormWithGlobalNormalizationGrad   rT   r   )r;   r=   r>   rV   rW   rZ   ru   r   r   r   r   r   r   r   r   r   rY   r   r   r   r   rX   r   r   r   rA   rG   r   r+   )r   r   r   r   r   r   r   r    r!   r[   r   rP   rO   rJ   s                 rQ   r   r   3  sb   (()9;MN&001JLgh661a7QSVY`YhYhjqjyjy  |C  |I  |I  KR  KX  KX  Za  Zg  Zg  ip  iu  iu  w~  wH  wH  JQ  JW  JW  Y`  Yf  Yf  ho  hv  hv  x  xF  xF  HO  HX  HX  Za  Zh  Zh  jq  jy  jy  {B  {I  {I  KR  K]  K]  _f  _k  _k  mt  m{  m{  }D  }K  }K  YN  O'9(1aE8Q5(+,,.>8:&Da$0C"&(' ""$.fgO7==gF'	.r\   TV_BiasAdd_Tbiasc           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |d}t        j                  |d      }t        j                   d| |||      \  }}}	}
|
dd }t        j"                         rHd|	j%                  d      d|	j'                  d      f}|	j(                  }t        j*                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Adds `bias` to `value`.

  This is a special case of `tf.add` where `bias` is restricted to be 1-D.
  Broadcasting is supported, so `value` may have any number of dimensions.

  Args:
    value: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`.
      Any number of dimensions.
    bias: A `Tensor`. Must have the same type as `value`.
      1-D with size the last dimension of `value`.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the bias tensor will be added to the last dimension
      of the value tensor.
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
      The tensor will be added to "in_channels", the third-to-the-last
          dimension.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `value`.
  BiasAddra   Nra   r    r!   r^   )r_   r   ra   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   bias_add_eager_fallbackr4   r;   rn   r?   r@   rA   rE   rC   rF   rG   )r_   r   ra   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                rQ   bias_addr   G  sv   0 
			0h..0$#\\11iudM;Hgn K!!+}=+'88T{O!QXQK'""$3%%c*Mll=)+F::L<2('	./ && -
##At,,## 
$
;TtE E## 
0    C= =ED++EEE E/.E/zraw_ops.BiasAddc                 `   |d}t        j                  |d      }t        j                  | |g|t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  t        j*                  t        j,                  g      \  }}|\  } }| |g}d|d|f}t        j.                  dd||||      }	t        j0                         rt        j2                  d|||	       |	\  }	|	S )Nr^   ra   r%   s   BiasAddrs   rT   r   r;   rn   rV   rW   rZ   ru   r   r   r   r   r   r   r   r   r   rY   r   r   r   r   rX   r   r   r   rA   rG   )
r_   r   ra   r    r!   r[   r   rP   rO   rJ   s
             rQ   r   r     s   K!!+}=+66t}cGOO]d]l]lnun{n{  ~E  ~K  ~K  MT  MZ  MZ  \c  \h  \h  jq  j{  j{  }D  }J  }J  LS  LY  LY  [b  [i  [i  kr  ky  ky  {B  {K  {K  MT  M[  M[  ]d  ]l  ]l  nu  n|  n|  ~E  ~P  ~P  RY  R^  R^  `g  `n  `n  pw  p~  p~  LA  B'9-5$,-5&Z<v!$41'""$<2('	.r\   TV_BiasAddGrad_Tout_backpropc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|      }|S |d}t        j                  |d      }t        j                   d| ||      \  }}}}	|	dd }t        j"                         rHd|j%                  d      d|j'                  d      f}
|j(                  }t        j*                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a  The backward operation for "BiasAdd" on the "bias" tensor.

  It accumulates all the values from out_backprop into the feature dimension.
  For NHWC data format, the feature dimension is the last. For NCHW data format,
  the feature dimension is the third-to-last.

  Args:
    out_backprop: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`.
      Any number of dimensions.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the bias tensor will be added to the last dimension
      of the value tensor.
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
      The tensor will be added to "in_channels", the third-to-the-last
          dimension.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `out_backprop`.
  BiasAddGradra   Nr   r^   )r   ra   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   bias_add_grad_eager_fallbackr4   r;   rn   r?   r@   rA   rE   rC   rF   rG   )r   ra   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s               rQ   bias_add_gradr     sr   . 
			0h..0$#\\11mT<Mgn K!!+}=+'88Lk "!QX QK'""$3%%c*Mll=)+F::L|VW6('	.1 && -
##At,,## 
)
KdF F## 
0    C; ;ED))EEE E,+E,zraw_ops.BiasAddGradc                 V   |d}t        j                  |d      }t        j                  | g|t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  t        j*                  t        j,                  g      \  }\  } | g}d|d|f}t        j.                  dd||||      }t        j0                         rt        j2                  d|||       |\  }|S )Nr^   ra   r%   s   BiasAddGradrs   rT   r   r   )r   ra   r    r!   r[   rP   rO   rJ   s           rQ   r   r     s   K!!+}=+%<<l^SSZSbSbdkdsdsu|  vC  vC  EL  ER  ER  T[  Ta  Ta  cj  co  co  qx  qB  qB  DK  DQ  DQ  SZ  S`  S`  bi  bp  bp  ry  r@  r@  BI  BR  BR  T[  Tb  Tb  dk  ds  ds  u|  uC  uC  EL  EW  EW  Y`  Ye  Ye  gn  gu  gu  w~  wE  wE  SH  I'?L,-5&^Q|#)s?'""$|VW6('	.r\   TV_BiasAddV1_Tc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        j                  d| ||      \  }}}}	|	dd }t        j                          r7d|j#                  d      f}
|j$                  }t        j&                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a  Adds `bias` to `value`.

  This is a deprecated version of BiasAdd and will be soon removed.

  This is a special case of `tf.add` where `bias` is restricted to be 1-D.
  Broadcasting is supported, so `value` may have any number of dimensions.

  Args:
    value: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`.
      Any number of dimensions.
    bias: A `Tensor`. Must have the same type as `value`.
      1-D with size the last dimension of `value`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `value`.
  	BiasAddV1Nr    r!   )r_   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   bias_add_v1_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   )r_   r   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s               rQ   bias_add_v1r     s=   $ 
			0h..0$#\\11k4.gn (885t$8!QXQK'""$3%%c*+F::L\674('	.' && -
##At,,## 
'
Dd, ,## 
0    C D"C==DDD) )D?>D?zraw_ops.BiasAddV1c                 (   t        j                  | |g|t        j                  t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  t        j*                  g      \  }}|\  } }| |g}d|f}t        j,                  dd||||      }t        j.                         rt        j0                  d|||       |\  }|S )Nr%   s	   BiasAddV1rs   rT   r   )r;   rV   rW   rZ   ru   r   r   r   r   r   r   r   r   r   rY   r   r   r   r   rX   r   r   r   rA   rG   )	r_   r   r    r!   r[   r   rP   rO   rJ   s	            rQ   r   r     s   66t}cGOO]d]l]lnun{n{  ~E  ~K  ~K  MT  MZ  MZ  \c  \h  \h  jq  j{  j{  }D  }J  }J  LS  LY  LY  [b  [i  [i  kr  ky  ky  {B  {K  {K  MT  M[  M[  ]d  ]l  ]l  nu  n|  n|  ~E  ~P  ~P  RY  R^  R^  `g  `n  `n  pw  p~  p~  LA  B'9-5$,>&\1\#)s?'""$\674('	.r\   	TV_Conv_TconvCHANNELS_LASTrs   filter
batch_dimsgroupsc
                 L   t         j                   xs t        j                         }
|
j                  }|j                  r*	 t	        j
                  |
d|	| |d|d|d|d|d|d|d|      }|S t        | |||||||||	f
d	      }|t        ur|S t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}t5        j8                  |d      }|g }t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}|d}t5        j8                  |d      }|g }t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}|d}t5        j6                  |d      }|d}t5        j6                  |d      }	 t;        j<                  d| |||||||||	      \  }}}}|d	d	 }t5        j>                         rd|jA                  d      d|jC                  d      d|jC                  d      d|jC                  d      d|jC                  d      d|jC                  d      d|jE                  d      d|jE                  d      f}|jF                  }t5        jH                  d|||       |\  }|S # t        j                  $ r }t        j                  ||	       Y d	}~nd	}~wt        j                  $ r Y nw xY w	 t        | |||||||||	f
d	      }|t        ur|S t        | |||||||||	|

      S # t        j                  $ r Y t        t         f$ rP t#        j$                  t&        dt)        | |||||||||	
            }|t"        j*                  j,                  ur|cY S  w xY wc c}w c c}w c c}w # t        t         f$ rP t#        j$                  t&        dt)        | |||||||||	
            }|t"        j*                  j,                  ur|cY S  w xY w)a  Computes a N-D convolution given (N+1+batch_dims)-D `input` and (N+2)-D `filter` tensors.

  General function for computing a N-D convolution. It is required that
  `1 <= N <= 3`.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`, `int32`.
      Tensor of type T and shape `batch_shape + spatial_shape + [in_channels]` in the
      case that `channels_last_format = true` or shape
      `batch_shape + [in_channels] + spatial_shape` if `channels_last_format = false`.
      spatial_shape is N-dimensional with `N=2` or `N=3`.
      Also note that `batch_shape` is dictated by the parameter `batch_dims`
      and defaults to 1.
    filter: A `Tensor`. Must have the same type as `input`.
      An `(N+2)-D` Tensor with the same type as `input` and shape
      `spatial_filter_shape + [in_channels, out_channels]`, where spatial_filter_shape
      is N-dimensional with `N=2` or `N=3`.
    strides: A list of `ints`.
      1-D tensor of length `N+2`. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[N+1] = 1`.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
      If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith
      dimension, the amount of padding inserted before and after the dimension is
      `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If
      `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty.
    data_format: An optional `string` from: `"CHANNELS_FIRST", "CHANNELS_LAST"`. Defaults to `"CHANNELS_LAST"`.
      Used to set the data format. By default `CHANNELS_FIRST`, uses 
      `NHWC (2D) / NDHWC (3D)` or if `CHANNELS_LAST`, uses `NCHW (2D) / NCDHW (3D)`.
    dilations: An optional list of `ints`. Defaults to `[]`.
      1-D tensor of length `N+2`. The dilation factor for each dimension of
      `input`. If set to `k > 1`, there will be `k-1` skipped cells between each
      filter element on that dimension. The dimension order is determined by the
      value of `channels_last_format`, see above for details. Dilations in the batch
      and depth dimensions must be 1.
    batch_dims: An optional `int`. Defaults to `1`.
      A positive integer specifying the number of batch dimensions for the input
      tensor. Should be less than the rank of the input tensor.
    groups: An optional `int`. Defaults to `1`.
      A positive integer specifying the number of groups in which the input is split
      along the channel axis. Each group is convolved separately with
      `filters / groups` filters. The output is the concatenation of all the groups
      results along the channel axis. Input channels and filters must both be
      divisible by groups.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Convrf   r`   explicit_paddingsra   	dilationsr   r   N)	rf   r`   r   ra   r   r   r   r    r!   r"   )
r   r   rf   r`   r   ra   r   r   r   r    :Expected list for 'strides' argument to 'conv' Op, not %r.DExpected list for 'explicit_paddings' argument to 'conv' Op, not %r.r   <Expected list for 'dilations' argument to 'conv' Op, not %r.rs   r%   )%r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   _dispatcher_for_convr2   conv_eager_fallbackr4   r5   r6   r7   r   r   r8   r9   r:   rk   rl   rm   r;   r<   rn   r?   r@   rA   rE   rC   rB   rF   rG   )r   r   rf   r`   r   ra   r   r   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                       rQ   r   r   #  s   l 
			0h..0$#\\
11fdE69gy$&7[)\:&	g
 n< #	*;[:vt	./35G n$n	GdE]	+
	&	'( ( 9@@"Xr9-@'@gy1'	%e}	5
	0	12 2 M^^bx((-@A^^!K!!+}=+I	Ie}	-
	(	)* * =FFbx  [1F)FJ  \:*^FVX.&
)::eFGW"3#
6	Aq#x QK'""$3%%c*Ill9%y#,,y2I!3<<0C#DS\\-8+ll;'-x)+F ::Lfg/('	.{ && -
##At,,## 
$&'7,={
Z0157g 
	& 
'-;*V	 
 ## 
z" 
"""dvw#*->'2i&0d	Lg 
	..<<	<
, A _ G Z	  	
  
DuVW!(<M%0I$.vDJ
G i,,:::n		
sb    (J= 1N5N:7N?%O =LK++LLL> (L> >N2AN20N2AP#!P#zraw_ops.Convc                 @   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|d}t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}|d
}t	        j
                  |d      }|d
}t	        j
                  |d      }t	        j                  | |g|
t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }}|\  } }| |g}d|d|d|d|d|d	|d|d|f}t	        j                  dd
|||
|	      }t	        j                         rt	        j                   d|||       |\  }|S c c}w c c}w c c}w )Nr   rf   r`   r   r   r   ra   r   r   rs   r   r   r%   s   ConvrT   r   )rk   rl   rm   r5   r;   r<   rn   rV   rW   rX   rY   rZ   ru   r   r   rA   rG   )r   r   rf   r`   r   ra   r   r   r   r    r!   ro   r[   r   rP   rO   rJ   s                    rQ   r   r     sl   	GdE]	+
	&	'( ( 9@@"Xr9-@'@gy1'	%e}	5
	0	12 2 M^^bx((-@A^^!K!!+}=+I	Ie}	-
	(	)* * =FFbx  [1F)FJ  \:*^FVX.&66vgll\c\l\lnun}n}  @G  @O  @O  QX  Q^  Q^  Na  b'9/5&,)Wi(-y,
HfF& WaF!$41'""$fg/('	.K A _ Gs   H
H/HTV_Conv2D_Trs   rs   rs   rs   use_cudnn_on_gpuc	                    t         j                   xs t        j                         }	|	j                  }
|
j                  r(	 t	        j
                  |	d|| |d|d|d|d|d|d|      }|S t        |t        t        f      st!        d
|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d}t#        j(                  |d      }|g }t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}|d}t#        j&                  |d      }|g d}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t+        j,                  d| ||||||||
      \  }}}}|dd }t#        j.                         rd|j1                  d      d|j3                  d      d|j5                  d      d|j3                  d      d|j3                  d      d|j3                  d      d|j3                  d      f}|j6                  }t#        j8                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||		
      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )a'  Computes a 2-D convolution given 4-D `input` and `filter` tensors.

  Given an input tensor of shape `[batch, in_height, in_width, in_channels]`
  and a filter / kernel tensor of shape
  `[filter_height, filter_width, in_channels, out_channels]`, this op
  performs the following:

  1. Flattens the filter to a 2-D matrix with shape
     `[filter_height * filter_width * in_channels, output_channels]`.
  2. Extracts image patches from the input tensor to form a *virtual*
     tensor of shape `[batch, out_height, out_width,
     filter_height * filter_width * in_channels]`.
  3. For each patch, right-multiplies the filter matrix and the image patch
     vector.

  In detail, with the default NHWC format,

      output[b, i, j, k] =
          sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] *
                          filter[di, dj, q, k]

  Must have `strides[0] = strides[3] = 1`.  For the most common case of the same
  horizontal and vertices strides, `strides = [1, stride, stride, 1]`.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`, `int32`.
      A 4-D tensor. The dimension order is interpreted according to the value
      of `data_format`, see below for details.
    filter: A `Tensor`. Must have the same type as `input`.
      A 4-D tensor of shape
      `[filter_height, filter_width, in_channels, out_channels]`
    strides: A list of `ints`.
      1-D tensor of length 4.  The stride of the sliding window for each
      dimension of `input`. The dimension order is determined by the value of
      `data_format`, see below for details.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    use_cudnn_on_gpu: An optional `bool`. Defaults to `True`.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
      If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith
      dimension, the amount of padding inserted before and after the dimension is
      `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If
      `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, height, width, channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, channels, height, width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      1-D tensor of length 4.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each
      filter element on that dimension. The dimension order is determined by the
      value of `data_format`, see above for details. Dilations in the batch and
      depth dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Conv2Drf   r   r`   r   ra   r   Nrf   r   r`   r   ra   r   r    r!   <Expected list for 'strides' argument to 'conv2d' Op, not %r.TFExpected list for 'explicit_paddings' argument to 'conv2d' Op, not %r.r^   r   >Expected list for 'dilations' argument to 'conv2d' Op, not %r.)	r   r   rf   r`   r   r   ra   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   conv2d_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   )r   r   rf   r`   r   r   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                      rQ   conv2dr     s@   z 
			0h..0$#\\
11heVY,i.{Y	 g
 n 
GdE]	+
	!(	)* * 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	!2	34 4 M^^bx((-@A^^K!!+}=+I	Ie}	-
	!*	+, , =FFbx  [1F)F'88fg!4D$5)YT	K!QX
 QK'""$3%%c*Ill9%'9  !34ill9%':ll./ll=);ll;')F ::L,1('	.q && -
##At,,## 
"
;K->!YTtM M ## 
 A _ GsB    &I0 K*
K/1K40J7JJ76J7;K K'&K'zraw_ops.Conv2Dc
                    t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
t	        j                  |d      }|d}t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
|d}t	        j                  |d	      }|g d
}t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
t	        j                  | |g|	t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }}|\  } }| |g}d|d|d|d|d|d	|d|f}t	        j                  dd|||	|      }t	        j                          rt	        j"                  d|||       |\  }|S c c}
w c c}
w c c}
w )Nr   rf   r`   Tr   r   r   r^   ra   r   r   r   r%   s   Conv2Drs   rT   r   rk   rl   rm   r5   r;   r<   rn   r>   rV   rW   rX   rY   rZ   ru   r   r   rA   rG   )r   r   rf   r`   r   r   ra   r   r    r!   ro   r[   r   rP   rO   rJ   s                   rQ   r   r   y  sQ   	GdE]	+
	!(	)* * 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	!2	34 4 M^^bx((-@A^^K!!+}=+I	Ie}	-
	!*	+, , =FFbx  [1F)F66vgll\c\l\lnun}n}  @G  @O  @O  QX  Q^  Q^  Na  b'9/5&,)W.@Iw(;]KiI& Y,f!$41'""$,1('	.E A _ Gs   G7$G<HTV_Conv2DBackpropFilter_Tfilter_sizesc
                    t         j                   xs t        j                         }
|
j                  }|j                  r)	 t	        j
                  |
d|	| ||d|d|d|d|d|d|      }|S t        |t        t        f      st!        d
|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d}t#        j(                  |d      }|g }t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}|d}t#        j&                  |d      }|g d}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t+        j,                  d| |||||||||	      \  }}}}|dd }t#        j.                         rd|j1                  d      d|j3                  d      d|j5                  d      d|j3                  d      d|j3                  d      d|j3                  d      d|j3                  d      f}|j6                  }t#        j8                  d|||       |\  }|S # t        j                  $ r }t        j                  ||	       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
	      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )a	  Computes the gradients of convolution with respect to the filter.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      4-D with shape `[batch, in_height, in_width, in_channels]`.
    filter_sizes: A `Tensor` of type `int32`.
      An integer vector representing the tensor shape of `filter`,
      where `filter` is a 4-D
      `[filter_height, filter_width, in_channels, out_channels]` tensor.
    out_backprop: A `Tensor`. Must have the same type as `input`.
      4-D with shape `[batch, out_height, out_width, out_channels]`.
      Gradients w.r.t. the output of the convolution.
    strides: A list of `ints`.
      The stride of the sliding window for each dimension of the input
      of the convolution. Must be in the same order as the dimension specified with
      format.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    use_cudnn_on_gpu: An optional `bool`. Defaults to `True`.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
      If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith
      dimension, the amount of padding inserted before and after the dimension is
      `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If
      `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      1-D tensor of length 4.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each filter
      element on that dimension. The dimension order is determined by the value of
      `data_format`, see above for details. Dilations in the batch and depth
      dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Conv2DBackpropFilterrf   r   r`   r   ra   r   Nr   LExpected list for 'strides' argument to 'conv2d_backprop_filter' Op, not %r.TVExpected list for 'explicit_paddings' argument to 'conv2d_backprop_filter' Op, not %r.r^   r   NExpected list for 'dilations' argument to 'conv2d_backprop_filter' Op, not %r.)
r   r   r   rf   r`   r   r   ra   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   %conv2d_backprop_filter_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   )r   r   r   rf   r`   r   r   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                       rQ   conv2d_backprop_filterr    sJ   T 
			0h..0$#\\
11$dE<7.0@)$&7[)	-g
 n 
GdE]	+
	/18	9: : 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	/1B	CD D M^^bx((-@A^^K!!+}=+I	Ie}	-
	/1:	;< < =FFbx  [1F)F'88e,-97(/1A2C,79%)+!QX QK'""$3%%c*Ill9%'9  !34ill9%':ll./ll=);ll;')F ::Lfg?('	.y && -
##At,,## 
2
|W+W-;Dd	4 4
 ## 
 A _ GB    'I2 K-K22K72J9J  J98J9=K K*)K*zraw_ops.Conv2DBackpropFilterc                 8   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|d}t	        j                  |d	      }|g d
}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  | |g|
t        j                  t        j                  t        j                  t        j                  g      \  }}|\  } }t        j                  |t        j                         }| ||g}d|d|d|d|d|d	|d|f}t	        j"                  dd|||
|	      }t	        j$                         rt	        j&                  d|||       |\  }|S c c}w c c}w c c}w )Nr  rf   r`   Tr   r  r   r^   ra   r   r  r   r%   s   Conv2DBackpropFilterrs   rT   r  )rk   rl   rm   r5   r;   r<   rn   r>   rV   rW   rX   rY   rZ   ru   r.   r   r   r   rA   rG   )r   r   r   rf   r`   r   r   ra   r   r    r!   ro   r[   r   rP   rO   rJ   s                    rQ   r  r    sf   	GdE]	+
	/18	9: : 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	/1B	CD D M^^bx((-@A^^K!!+}=+I	Ie}	-
	/1:	;< < =FFbx  [1F)F66|7LcT[T`T`bibrbrt{  uD  uD  FM  FU  FU  TX  Y'9#5,''gmmD,|4,)W.@Iw(;]KiI& 4a#)s?'""$fg?('	.G A _ Gs   H$HHTV_Conv2DBackpropFilterV2_Tconv2d_backprop_filter_v2c
                    t         j                   xs t        j                         }
|
j                  }|j                  r)	 t	        j
                  |
d|	| ||d|d|d|d|d|d|      }|S t        | |||||||||	f
d      }|t        ur|S t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}t5        j8                  |d      }|d}t5        j:                  |d      }|g }t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}|d}t5        j8                  |d      }|g d}t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}	 t=        j>                  d| |||||||||	      \  }}}}|dd }t5        j@                         rd|jC                  d      d|jE                  d      d|jG                  d      d|jE                  d      d|jE                  d      d|jE                  d      d|jE                  d      f}|jH                  }t5        jJ                  d|||       |\  }|S # t        j                  $ r }t        j                  ||	       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	f
d      }|t        ur|S t        | |||||||||	|
	      S # t        j                  $ r Y t        t         f$ rP t#        j$                  t&        d
t)        | |||||||||	
            }|t"        j*                  j,                  ur|cY S  w xY wc c}w c c}w c c}w # t        t         f$ rP t#        j$                  t&        d
t)        | |||||||||	
            }|t"        j*                  j,                  ur|cY S  w xY w)a  Computes the gradients of convolution with respect to the filter.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      4-D with shape `[batch, in_height, in_width, in_channels]`.
    filter: A `Tensor`. Must have the same type as `input`.
      4-D with shape `[filter_height, filter_width, in_channels, out_channels]`.
      Only shape of tensor is used.
    out_backprop: A `Tensor`. Must have the same type as `input`.
      4-D with shape `[batch, out_height, out_width, out_channels]`.
      Gradients w.r.t. the output of the convolution.
    strides: A list of `ints`.
      The stride of the sliding window for each dimension of the input
      of the convolution. Must be in the same order as the dimension specified with
      format.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    use_cudnn_on_gpu: An optional `bool`. Defaults to `True`.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
      If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith
      dimension, the amount of padding inserted before and after the dimension is
      `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If
      `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      1-D tensor of length 4.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each filter
      element on that dimension. The dimension order is determined by the value of
      `data_format`, see above for details. Dilations in the batch and depth
      dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Conv2DBackpropFilterV2rf   r   r`   r   ra   r   Nr   r"   
r   r   r   rf   r`   r   r   ra   r   r    OExpected list for 'strides' argument to 'conv2d_backprop_filter_v2' Op, not %r.TYExpected list for 'explicit_paddings' argument to 'conv2d_backprop_filter_v2' Op, not %r.r^   r   QExpected list for 'dilations' argument to 'conv2d_backprop_filter_v2' Op, not %r.r%   )&r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   )_dispatcher_for_conv2d_backprop_filter_v2r2   (conv2d_backprop_filter_v2_eager_fallbackr4   r5   r6   r7   r   r  r8   r9   r:   rk   rl   rm   r;   r<   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   r   r   r   rf   r`   r   r   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                       rQ   r  r  G  s   X 
			0h..0$#\\
11&eV\7.0@)$&7[)	-g
 nD 8	gw8H;	4	:;?AG n$n	GdE]	+
	24;	<= = 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	24E	FG G M^^bx((-@A^^K!!+}=+I	Ie}	-
	24=	>? ? =FFbx  [1F)F
):: f/;W*13C4E.9,5DBAq#x, QK'""$3%%c*Ill9%'9  !34ill9%':ll./ll=);ll;')F ::L ,A('	.K && -
##At,,## 
9&,:J
[)T<=ACg 
	&5
w+W-;Dd	4 4
 ## 
z" ""%r4eF=I8?8?AQBS<G:C59,;
g 
	..<<	<4 A _ G Z	  
  
#RE&;G6=6=?O@Q:E8A*N	
G i,,:::n	
b    'J 0N+NN2%N K&KKKL >L N*ANNAO97O9zraw_ops.Conv2DBackpropFilterV2c                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|d}t	        j                  |d	      }|g d
}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  | ||g|
t        j                  t        j                  t        j                  t        j                  g      \  }}|\  } }}| ||g}d|d|d|d|d|d	|d|f}t	        j                  dd|||
|	      }t	        j                         rt	        j                   d|||       |\  }|S c c}w c c}w c c}w )Nr  rf   r`   Tr   r  r   r^   ra   r   r  r   r%   s   Conv2DBackpropFilterV2rs   rT   r  )rk   rl   rm   r5   r;   r<   rn   r>   rV   rW   rX   rY   rZ   ru   r   rA   rG   r   r   r   rf   r`   r   r   ra   r   r    r!   ro   r[   r   rP   rO   rJ   s                    rQ   r  r    s]   	GdE]	+
	24;	<= = 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	24E	FG G M^^bx((-@A^^K!!+}=+I	Ie}	-
	24=	>? ? =FFbx  [1F)F66v|7TVY\c\h\hjqjzjz  }D  }L  }L  NU  N]  N]  \`  a'9"+5&,.,)W.@Iw(;]KiI& 6$0C"&(' ""$ ,A('	.G A _ Gs   G+$G0G5TV_Conv2DBackpropInput_Tinput_sizesc
                    t         j                   xs t        j                         }
|
j                  }|j                  r)	 t	        j
                  |
d|	| ||d|d|d|d|d|d|      }|S t        |t        t        f      st!        d
|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d}t#        j(                  |d      }|g }t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}|d}t#        j&                  |d      }|g d}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t+        j,                  d| |||||||||	      \  }}}}|dd }t#        j.                         rd|j1                  d      d|j3                  d      d|j5                  d      d|j3                  d      d|j3                  d      d|j3                  d      d|j3                  d      f}|j6                  }t#        j8                  d|||       |\  }|S # t        j                  $ r }t        j                  ||	       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
	      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )a	  Computes the gradients of convolution with respect to the input.

  Args:
    input_sizes: A `Tensor` of type `int32`.
      An integer vector representing the shape of `input`,
      where `input` is a 4-D `[batch, height, width, channels]` tensor.
    filter: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`, `int32`.
      4-D with shape
      `[filter_height, filter_width, in_channels, out_channels]`.
    out_backprop: A `Tensor`. Must have the same type as `filter`.
      4-D with shape `[batch, out_height, out_width, out_channels]`.
      Gradients w.r.t. the output of the convolution.
    strides: A list of `ints`.
      The stride of the sliding window for each dimension of the input
      of the convolution. Must be in the same order as the dimension specified with
      format.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    use_cudnn_on_gpu: An optional `bool`. Defaults to `True`.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
      If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith
      dimension, the amount of padding inserted before and after the dimension is
      `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If
      `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      1-D tensor of length 4.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each filter
      element on that dimension. The dimension order is determined by the value of
      `data_format`, see above for details. Dilations in the batch and depth
      dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `filter`.
  Conv2DBackpropInputrf   r   r`   r   ra   r   Nr   KExpected list for 'strides' argument to 'conv2d_backprop_input' Op, not %r.TUExpected list for 'explicit_paddings' argument to 'conv2d_backprop_input' Op, not %r.r^   r   MExpected list for 'dilations' argument to 'conv2d_backprop_input' Op, not %r.)
r  r   r   rf   r`   r   r   ra   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   $conv2d_backprop_input_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   )r  r   r   rf   r`   r   r   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                       rQ   conv2d_backprop_inputr     sJ   T 
			0h..0$#\\
11#T;7.0@)$&7[)	-g
 n 
GdE]	+
	.07	89 9 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	.0A	BC C M^^bx((-@A^^K!!+}=+I	Ie}	-
	.09	:; ; =FFbx  [1F)F'88;v,8''.0@1B+6)$(*!QX QK'""$3%%c*Ill9%'9  !34ill9%':ll./ll=);ll;')F ::L|VW>('	.y && -
##At,,## 
1
v|W+W-;Dd	4 4
 ## 
 A _ Gr  zraw_ops.Conv2DBackpropInputc                 V   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|d}t	        j                  |d	      }|g d
}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  ||g|
t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }}|\  }}t        j                   | t        j                        } | ||g}d|d|d|d|d|d	|d|f}t	        j"                  dd|||
|	      }t	        j$                         rt	        j&                  d|||       |\  }|S c c}w c c}w c c}w )Nr  rf   r`   Tr   r  r   r^   ra   r   r  r   r%   s   Conv2DBackpropInputrs   rT   r  )rk   rl   rm   r5   r;   r<   rn   r>   rV   rW   rX   rY   rZ   ru   r   r.   r   r   rA   rG   )r  r   r   rf   r`   r   r   ra   r   r    r!   ro   r[   r   rP   rO   rJ   s                    rQ   r  r    s{   	GdE]	+
	.07	89 9 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	.0A	BC C M^^bx((-@A^^K!!+}=+I	Ie}	-
	.09	:; ; =FFbx  [1F)F667MsU\UaUacjcscsu|  vE  vE  GN  GV  GV  X_  Xe  Xe  Uh  i'9$6<&&{GMMB+v|4,)W.@Iw(;]KiI& 3Q|#)s?'""$|VW>('	.G A _ Gs   H$H!H&TV_Conv2DBackpropInputV2_Tconv2d_backprop_input_v2c
                    t         j                   xs t        j                         }
|
j                  }|j                  r)	 t	        j
                  |
d|	| ||d|d|d|d|d|d|      }|S t        | |||||||||	f
d      }|t        ur|S t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}t5        j8                  |d      }|d}t5        j:                  |d      }|g }t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}|d}t5        j8                  |d      }|g d}t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}	 t=        j>                  d| |||||||||	      \  }}}}|dd }t5        j@                         rd|jC                  d      d|jE                  d      d|jG                  d      d|jE                  d      d|jE                  d      d|jE                  d      d|jE                  d      f}|jH                  }t5        jJ                  d|||       |\  }|S # t        j                  $ r }t        j                  ||	       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	f
d      }|t        ur|S t        | |||||||||	|
	      S # t        j                  $ r Y t        t         f$ rP t#        j$                  t&        d
t)        | |||||||||	
            }|t"        j*                  j,                  ur|cY S  w xY wc c}w c c}w c c}w # t        t         f$ rP t#        j$                  t&        d
t)        | |||||||||	
            }|t"        j*                  j,                  ur|cY S  w xY w)a  Computes the gradients of convolution with respect to the input.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`, `int32`.
      4-D with shape `[batch, in_height, in_width, in_channels]`.
      Only shape of tensor is used.
    filter: A `Tensor`. Must have the same type as `input`. 4-D with shape
      `[filter_height, filter_width, in_channels, out_channels]`.
    out_backprop: A `Tensor`. Must have the same type as `input`.
      4-D with shape `[batch, out_height, out_width, out_channels]`.
      Gradients w.r.t. the output of the convolution.
    strides: A list of `ints`.
      The stride of the sliding window for each dimension of the input
      of the convolution. Must be in the same order as the dimension specified with
      format.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    use_cudnn_on_gpu: An optional `bool`. Defaults to `True`.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
      If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith
      dimension, the amount of padding inserted before and after the dimension is
      `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If
      `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      1-D tensor of length 4.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each filter
      element on that dimension. The dimension order is determined by the value of
      `data_format`, see above for details. Dilations in the batch and depth
      dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Conv2DBackpropInputV2rf   r   r`   r   ra   r   Nr   r"   r  NExpected list for 'strides' argument to 'conv2d_backprop_input_v2' Op, not %r.TXExpected list for 'explicit_paddings' argument to 'conv2d_backprop_input_v2' Op, not %r.r^   r   PExpected list for 'dilations' argument to 'conv2d_backprop_input_v2' Op, not %r.r%   )&r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   (_dispatcher_for_conv2d_backprop_input_v2r2   'conv2d_backprop_input_v2_eager_fallbackr4   r5   r6   r7   r   r#  r8   r9   r:   rk   rl   rm   r;   r<   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   r  s                       rQ   r#  r#    s   X 
			0h..0$#\\
11%tUFL7.0@)$&7[)	-g
 nB 7	gw8H;	4	:;?AG n$n	GdE]	+
	13:	;< < 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	13D	EF F M^^bx((-@A^^K!!+}=+I	Ie}	-
	13<	=> > =FFbx  [1F)F
)::uV.:G)02B3D-8I&*,Aq#x* QK'""$3%%c*Ill9%'9  !34ill9%':ll./ll=);ll;')F ::Lvw@('	.G && -
##At,,## 
8&,:J
[)T<=ACg 
	&4
w+W-;Dd	4 4
 ## 
z" ""$b$U6<H7>7>@PAR;F9B+O	g 
	..<<	<2 A _ G Z	  
  
"B5:F5<g>N?P9D7@t)M
G i,,:::n	
r  zraw_ops.Conv2DBackpropInputV2c                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|d}t	        j                  |d	      }|g d
}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  | ||g|
t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }}|\  } }}| ||g}d|d|d|d|d|d	|d|f}t	        j                  dd|||
|	      }t	        j                          rt	        j"                  d|||       |\  }|S c c}w c c}w c c}w )Nr&  rf   r`   Tr   r'  r   r^   ra   r   r(  r   r%   s   Conv2DBackpropInputV2rs   rT   r%  r   r  s                    rQ   r*  r*  V  so   	GdE]	+
	13:	;< < 9@@"Xr9-@'@gy1'''(8:LM	%e}	5
	13D	EF F M^^bx((-@A^^K!!+}=+I	Ie}	-
	13<	=> > =FFbx  [1F)F66v|7TVY\c\h\hjqjzjz  }D  }L  }L  NU  N]  N]  _f  _l  _l  \o  p'9"+5&,.,)W.@Iw(;]KiI& 5q#)s?'""$vw@('	.E A _ Gs   G:$G?HTV_Conv3D_Trs   rs   rs   rs   rs   c                    t         j                   xs t        j                         }|j                  }|j                  r$	 t	        j
                  |d|| |d|d|d|d|      }	|	S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d	}t#        j&                  |d      }|g d
}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t)        j*                  d| ||||||      \  }}}}|dd }	t#        j,                         r{d|j/                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      f
}|j2                  }t#        j4                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w c c}w )a  Computes a 3-D convolution given 5-D `input` and `filter` tensors.

  In signal processing, cross-correlation is a measure of similarity of
  two waveforms as a function of a time-lag applied to one of them. This
  is also known as a sliding dot product or sliding inner-product.

  Our Conv3D implements a form of cross-correlation.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      Shape `[batch, in_depth, in_height, in_width, in_channels]`.
    filter: A `Tensor`. Must have the same type as `input`.
      Shape `[filter_depth, filter_height, filter_width, in_channels,
      out_channels]`. `in_channels` must match between `input` and `filter`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NDHWC", "NCDHW"`. Defaults to `"NDHWC"`.
      The data format of the input and output data. With the
      default format "NDHWC", the data is stored in the order of:
          [batch, in_depth, in_height, in_width, in_channels].
      Alternatively, the format could be "NCDHW", the data storage order is:
          [batch, in_channels, in_depth, in_height, in_width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1, 1]`.
      1-D tensor of length 5.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each
      filter element on that dimension. The dimension order is determined by the
      value of `data_format`, see above for details. Dilations in the batch and
      depth dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Conv3Drf   r`   ra   r   Nrf   r`   ra   r   r    r!   <Expected list for 'strides' argument to 'conv3d' Op, not %r.rx   r-  >Expected list for 'dilations' argument to 'conv3d' Op, not %r.)r   r   rf   r`   ra   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   conv3d_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   )r   r   rf   r`   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                    rQ   conv3dr4    s   J 
			0h..0$#\\11heVY[)Eg n 
GdE]	+
	!(	)* * 9@@"Xr9-@'@gy1'K!!+}=+I	Ie}	-
	!*	+, , =FFbx  [1F)F'88fg!{%D2!QX QK'""$3%%c*Ill9%y#,,y2IS\\-8+ll;')F ::L,1('	.S && -
##At,,## 
"
'!YTtM M ## 
 A Gs<    "G# II #H*6HH*)H*.I IIzraw_ops.Conv3Dc           
         t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  | |g|t        j                  t        j                  t        j                  t        j                  g      \  }	}
|
\  } }| |g}d	|	d|d|d|d|f
}t	        j                  d
d||||      }t	        j                         rt	        j                  d|||       |\  }|S c c}w c c}w )Nr1  rf   r`   rx   ra   r-  r2  r   r%   s   Conv3Drs   rT   r/  rt   )r   r   rf   r`   ra   r   r    r!   ro   r[   r   rP   rO   rJ   s                 rQ   r3  r3    s   	GdE]	+
	!(	)* * 9@@"Xr9-@'@gy1'K!!+}=+I	Ie}	-
	!*	+, , =FFbx  [1F)F66vgll\c\l\lnun}n}  @G  @O  @O  NR  S'9/5&,)Wik96&Y,f!$41'""$,1('	./ A Gs   E?&FTV_Conv3DBackpropFilter_Tc                 r   t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| ||d|d|d|      }	|	S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|g d}t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t)        j*                  d| ||||||
      \  }}}}|dd }	t#        j,                         rjd|j/                  d      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w c c}w )a
  Computes the gradients of 3-D convolution with respect to the filter.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`.
      Shape `[batch, depth, rows, cols, in_channels]`.
    filter: A `Tensor`. Must have the same type as `input`.
      Shape `[depth, rows, cols, in_channels, out_channels]`.
      `in_channels` must match between `input` and `filter`.
    out_backprop: A `Tensor`. Must have the same type as `input`.
      Backprop signal of shape `[batch, out_depth, out_rows, out_cols,
      out_channels]`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1, 1]`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Conv3DBackpropFilterrf   r`   r   Nrf   r`   r   r    r!   LExpected list for 'strides' argument to 'conv3d_backprop_filter' Op, not %r.r-  NExpected list for 'dilations' argument to 'conv3d_backprop_filter' Op, not %r.r   r   r   rf   r`   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   %conv3d_backprop_filter_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   r   r   r   rf   r`   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                    rQ   conv3d_backprop_filterr?    sT   . 
			0h..0$#\\11$dE6<7IwYHg n 
GdE]	+
	/18	9: : 9@@"Xr9-@'@gy1'I	Ie}	-
	/1:	;< < =FFbx  [1F)F'88eF-97(/9%)	+!QX
 QK'""$3%%c*Ill9%y#,,y2I3<<46F ::Lfg?('	.M && -
##At,,## 
2
wDd4 4 ## 
 A G<    !F7 
H/-H47G>
G%%G>=G>H H,+H,zraw_ops.Conv3DBackpropFilterc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  | ||g|t        j                  t        j                  t        j                  g      \  }	}
|
\  } }}| ||g}d|	d|d|d|f}t	        j                  dd	||||
      }t	        j                         rt	        j                  d|||       |\  }|S c c}w c c}w )Nr:  rf   r`   r-  r;  r   r%   s   Conv3DBackpropFilterrs   rT   r8  rk   rl   rm   r5   r;   r<   rn   rV   rW   rX   rZ   ru   r   rA   rG   r   r   r   rf   r`   r   r    r!   ro   r[   r   rP   rO   rJ   s                 rQ   r=  r=  H	  s   	GdE]	+
	/18	9: : 9@@"Xr9-@'@gy1'I	Ie}	-
	/1:	;< < =FFbx  [1F)F66v|7TVY\c\h\hjqjyjy  |C  |K  |K  \N  O'9"+5&,.,)Wi+&4a#)s?'""$fg?('	.) A G   EETV_Conv3DBackpropFilterV2_Tznn.conv3d_backprop_filterznn.conv3d_backprop_filter_v2)v1c                    t         j                   xs t        j                         }|j                  }	|	j                  r%	 t	        j
                  |d|| ||d|d|d|d|      }
|
S t        | |||||||fd      }
|
t        ur|
S t/        |t0        t2        f      st        d
|z        |D cg c]  }t5        j6                  |d       }}t5        j8                  |d      }|d}t5        j8                  |d      }|g d}t/        |t0        t2        f      st        d|z        |D cg c]  }t5        j6                  |d       }}	 t;        j<                  d| |||||||		      \  }}}}|dd }
t5        j>                         r{d|jA                  d      d|jC                  d      d|jC                  d      d|jC                  d      d|jC                  d      f
}|jD                  }t5        jF                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||fd      }
|
t        ur|
S t        | ||||||||	      S # t        j                  $ r Y t        t         f$ rN t#        j$                  t&        dt)        | |||||||	            }
|
t"        j*                  j,                  ur|
cY S  w xY wc c}w c c}w # t        t         f$ rN t#        j$                  t&        dt)        | |||||||	            }
|
t"        j*                  j,                  ur|
cY S  w xY w)aE  Computes the gradients of 3-D convolution with respect to the filter.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      Shape `[batch, depth, rows, cols, in_channels]`.
    filter_sizes: A `Tensor` of type `int32`.
      An integer vector representing the tensor shape of `filter`,
      where `filter` is a 5-D
      `[filter_depth, filter_height, filter_width, in_channels, out_channels]`
      tensor.
    out_backprop: A `Tensor`. Must have the same type as `input`.
      Backprop signal of shape `[batch, out_depth, out_rows, out_cols,
      out_channels]`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NDHWC", "NCDHW"`. Defaults to `"NDHWC"`.
      The data format of the input and output data. With the
      default format "NDHWC", the data is stored in the order of:
          [batch, in_depth, in_height, in_width, in_channels].
      Alternatively, the format could be "NCDHW", the data storage order is:
          [batch, in_channels, in_depth, in_height, in_width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1, 1]`.
      1-D tensor of length 5.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each
      filter element on that dimension. The dimension order is determined by the
      value of `data_format`, see above for details. Dilations in the batch and
      depth dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Conv3DBackpropFilterV2rf   r`   ra   r   Nr0  r"   )r   r   r   rf   r`   ra   r   r    OExpected list for 'strides' argument to 'conv3d_backprop_filter_v2' Op, not %r.rx   r-  QExpected list for 'dilations' argument to 'conv3d_backprop_filter_v2' Op, not %r.r%   )$r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   )_dispatcher_for_conv3d_backprop_filter_v2r2   (conv3d_backprop_filter_v2_eager_fallbackr4   r5   r6   r7   r   conv3d_backprop_filter_v2r8   r9   r:   rk   rl   rm   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   )r   r   r   rf   r`   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                     rQ   rM  rM  f	  s   P 
			0h..0$#\\	11&e\i)Wm[)-g n> 8	lGWk4	!G n$n	GdE]	+
	24;	<= = 9@@"Xr9-@'@gy1'K!!+}=+I	Ie}	-
	24=	>? ? =FFbx  [1F)F
):: L/;W*1{,5D	BAq#x$ QK'""$3%%c*Ill9%y#,,y2IS\\-8+ll;')F ::L ,A('	.c && -
##At,,## 
9,gw
T!#g 
	&5
|Wg!YTtM M ## 
z" ""%r4e=I=I8?8?<G:C59,;	g 
	..<<	<2 A G Z	  
  
#RE;G;G6=6=:E8A*N
G i,,:::n	
s\    #H *K6'K;#L  IH22I
IJ -J K3AK31K3 AMMzraw_ops.Conv3DBackpropFilterV2c	           
      \   t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  |d      }|d}t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  | |g|t        j                  t        j                  t        j                  t        j                  g      \  }
}|\  } }t        j                  |t        j                        }| ||g}d	|
d|d|d|d|f
}t	        j                   d
d||||      }t	        j"                         rt	        j$                  d|||       |\  }|S c c}	w c c}	w )NrI  rf   r`   rx   ra   r-  rJ  r   r%   s   Conv3DBackpropFilterV2rs   rT   rH  r   )r   r   r   rf   r`   ra   r   r    r!   ro   r[   r   rP   rO   rJ   s                  rQ   rL  rL  	  s   	GdE]	+
	24;	<= = 9@@"Xr9-@'@gy1'K!!+}=+I	Ie}	-
	24=	>? ? =FFbx  [1F)F66|7LcT[T`T`bibrbrt{  uD  uD  FM  FU  FU  TX  Y'9#5,''gmmD,|4,)Wik96&6$0C"&(' ""$ ,A('	.3 A Gs   F$&F)TV_Conv3DBackpropInput_Tc                 r   t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| ||d|d|d|      }	|	S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|g d}t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t)        j*                  d| ||||||
      \  }}}}|dd }	t#        j,                         rjd|j/                  d      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w c c}w )a	  Computes the gradients of 3-D convolution with respect to the input.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`.
      Shape `[batch, depth, rows, cols, in_channels]`.
    filter: A `Tensor`. Must have the same type as `input`.
      Shape `[depth, rows, cols, in_channels, out_channels]`.
      `in_channels` must match between `input` and `filter`.
    out_backprop: A `Tensor`. Must have the same type as `input`.
      Backprop signal of shape `[batch, out_depth, out_rows, out_cols,
      out_channels]`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1, 1]`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Conv3DBackpropInputrf   r`   r   Nr9  KExpected list for 'strides' argument to 'conv3d_backprop_input' Op, not %r.r-  MExpected list for 'dilations' argument to 'conv3d_backprop_input' Op, not %r.r<  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   $conv3d_backprop_input_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   r>  s                    rQ   conv3d_backprop_inputrU  
  sT   . 
			0h..0$#\\11#T5&,7IwYHg n 
GdE]	+
	.07	89 9 9@@"Xr9-@'@gy1'I	Ie}	-
	.09	:; ; =FFbx  [1F)F'88U6,8''.)$(	*!QX
 QK'""$3%%c*Ill9%y#,,y2I3<<46F ::L|VW>('	.M && -
##At,,## 
1
wDd4 4 ## 
 A Gr@  zraw_ops.Conv3DBackpropInputc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  | ||g|t        j                  t        j                  t        j                  g      \  }	}
|
\  } }}| ||g}d|	d|d|d|f}t	        j                  dd	||||
      }t	        j                         rt	        j                  d|||       |\  }|S c c}w c c}w )NrR  rf   r`   r-  rS  r   r%   s   Conv3DBackpropInputrs   rT   rQ  rB  rC  s                 rQ   rT  rT  [
  s   	GdE]	+
	.07	89 9 9@@"Xr9-@'@gy1'I	Ie}	-
	.09	:; ; =FFbx  [1F)F66v|7TVY\c\h\hjqjyjy  |C  |K  |K  \N  O'9"+5&,.,)Wi+&3Q|#)s?'""$|VW>('	.) A GrD  TV_Conv3DBackpropInputV2_TTV_Conv3DBackpropInputV2_Tshapec                    t         j                   xs t        j                         }|j                  }	|	j                  r%	 t	        j
                  |d|| ||d|d|d|d|      }
|
S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d	}t#        j&                  |d      }|g d
}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t)        j*                  d| |||||||	      \  }}}}|dd }
t#        j,                         rd|j/                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j/                  d      f}|j2                  }t#        j4                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y w xY wc c}w c c}w )a  Computes the gradients of 3-D convolution with respect to the input.

  Args:
    input_sizes: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      An integer vector representing the tensor shape of `input`,
      where `input` is a 5-D
      `[batch, depth, rows, cols, in_channels]` tensor.
    filter: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      Shape `[depth, rows, cols, in_channels, out_channels]`.
      `in_channels` must match between `input` and `filter`.
    out_backprop: A `Tensor`. Must have the same type as `filter`.
      Backprop signal of shape `[batch, out_depth, out_rows, out_cols,
      out_channels]`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NDHWC", "NCDHW"`. Defaults to `"NDHWC"`.
      The data format of the input and output data. With the
      default format "NDHWC", the data is stored in the order of:
          [batch, in_depth, in_height, in_width, in_channels].
      Alternatively, the format could be "NCDHW", the data storage order is:
          [batch, in_channels, in_depth, in_height, in_width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1, 1]`.
      1-D tensor of length 5.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each
      filter element on that dimension. The dimension order is determined by the
      value of `data_format`, see above for details. Dilations in the batch and
      depth dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `filter`.
  Conv3DBackpropInputV2rf   r`   ra   r   Nr0  NExpected list for 'strides' argument to 'conv3d_backprop_input_v2' Op, not %r.rx   r-  PExpected list for 'dilations' argument to 'conv3d_backprop_input_v2' Op, not %r.)r  r   r   rf   r`   ra   r   r    r%   Tshape)r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   'conv3d_backprop_input_v2_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   )r  r   r   rf   r`   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                     rQ   conv3d_backprop_input_v2r_  z
  s   H 
			0h..0$#\\	11%t[&i)Wm[)-g n 
GdE]	+
	13:	;< < 9@@"Xr9-@'@gy1'K!!+}=+I	Ie}	-
	13<	=> > =FFbx  [1F)F'88[.:G)0k+44	A!QX
 QK'""$3%%c*Ill9%y#,,y2IS\\-8+ll;'  *	,F
 ::Lvw@('	.W && -
##At,,## 
4
v|Wg!YTtM M ## 
 A Gs<    #G6 I/	I46H=	H$$H=<H=I I,+I,zraw_ops.Conv3DBackpropInputV2c	                    t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  |d      }|d}t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  ||g|t        j                  t        j                  t        j                  t        j                  g      \  }
}|\  }}t	        j                  | g|t        j                  t        j                  gt        j                        \  }\  } | ||g}d	|
d|d|d|d|d
|f}t	        j                  dd||||      }t	        j                          rt	        j"                  d|||       |\  }|S c c}	w c c}	w )Nr[  rf   r`   rx   ra   r-  r\  r   r%   r]  s   Conv3DBackpropInputV2rs   rT   rZ  )rk   rl   rm   r5   r;   r<   rn   rV   rW   rX   rY   rZ   ru   r   r   r   rA   rG   )r  r   r   rf   r`   ra   r   r    r!   ro   r[   r   _attr_TshaperP   rO   rJ   s                   rQ   r^  r^  
  s   	GdE]	+
	13:	;< < 9@@"Xr9-@'@gy1'K!!+}=+I	Ie}	-
	13<	=> > =FFbx  [1F)F667MsU\UaUacjcscsu|  vE  vE  GN  GV  GV  UY  Z'9$6<!)!@!@+PSV]VcVcelererUuw~  xE  xE  "F,v|4,)Wik9hN&5q#)s?'""$vw@('	.1 A Gs   G&GTV_DataFormatDimMap_Tx
src_format
dst_formatc           
      <   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|d|      }|S |d}t        j                  |d      }|d}t        j                  |d      }t        j                   d| |||      \  }}}	}
|
dd }t        j"                         rYd	|	j%                  d	      d|	j'                  d      d|	j'                  d      f}|	j(                  }t        j*                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y <w xY w)
aB  Returns the dimension index in the destination data format given the one in

  the source data format.

  Args:
    x: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      A Tensor with each element as a dimension index in source data format.
      Must be in the range [-4, 4).
    src_format: An optional `string`. Defaults to `"NHWC"`.
      source data format.
    dst_format: An optional `string`. Defaults to `"NCHW"`.
      destination data format.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `x`.
  DataFormatDimMaprd  re  Nrd  re  r    r!   r^   NCHWrc  rd  re  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   "data_format_dim_map_eager_fallbackr4   r;   rn   r?   r@   rA   rE   rC   rF   rG   rc  rd  re  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                rQ   data_format_dim_maprm  
  s   $ 
			0h..0$#\\11 $<j"g n J  \:*J  \:*'88aJ:!%'!QX QK'""$3%%c*Lll<(,ll<(*F ::LL&';('	.; && -
##At,,## 
/

z  ## 
0    D) )E0<EE0/E04F FFzraw_ops.DataFormatDimMapc                    |d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j                  t        j
                  gt        j                        \  }\  } | g}d|d|d|f}t        j                  dd||||      }t        j                         rt        j                  d	|||       |\  }|S )
Nr^   rd  ri  re  r%   s   DataFormatDimMaprs   rT   rg  	r;   rn   rV   rW   r   r   r   rA   rG   	rc  rd  re  r    r!   r[   rP   rO   rJ   s	            rQ   rk  rk  5  s    J  \:*J  \:*111#sW]]GMM<\^e^k^kl-'4A,,
L*M&0!L#)s?'""$L&';('	.r\   TV_DataFormatVecPermute_Tc           
      <   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|d|      }|S |d}t        j                  |d      }|d}t        j                  |d      }t        j                   d| |||      \  }}}	}
|
dd }t        j"                         rYd	|	j%                  d	      d|	j'                  d      d|	j'                  d      f}|	j(                  }t        j*                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y <w xY w)
a  Permute input tensor from `src_format` to `dst_format`.

  Given source and destination format strings of length n=4 or 5, the input
  tensor must be a vector of size n or n-2, or a 2D tensor of shape
  (n, 2) or (n-2, 2).

  If the first dimension of the input tensor is n-2, it is assumed that
  non-spatial dimensions are omitted (i.e `N`, `C`).

  For example, with `src_format` of `NHWC`, `dst_format` of `NCHW`, and input:
  ```
  [1, 2, 3, 4]
  ```
  , the output will be:
  ```
  [1, 4, 2, 3]
  ```
  With `src_format` of `NDHWC`, `dst_format` of `NCDHW`, and input:
  ```
  [[1, 6], [2, 7], [3, 8], [4, 9], [5, 10]]
  ```
  , the output will be:
  ```
  [[1, 6], [5, 10], [2, 7], [3, 8], [4, 9]]
  ```
  With `src_format` of `NHWC`, `dst_format` of `NCHW`, and input:
  ```
  [1, 2]
  ```
  , the output will be:
  ```
  [1, 2]
  ```

  Args:
    x: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      Tensor of rank 1 or 2 in source data format.
    src_format: An optional `string`. Defaults to `"NHWC"`.
      source data format.
    dst_format: An optional `string`. Defaults to `"NCHW"`.
      destination data format.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `x`.
  DataFormatVecPermuterd  re  Nrh  r^   ri  rj  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   &data_format_vec_permute_eager_fallbackr4   r;   rn   r?   r@   rA   rE   rC   rF   rG   rl  s                rQ   data_format_vec_permuterv  J  s   ^ 
			0h..0$#\\11$dA|Zj"g n J  \:*J  \:*'88!
+5DB!QX QK'""$3%%c*Lll<(,ll<(*F ::Lfg?('	.; && -
##At,,## 
3

z  ## 
rn  zraw_ops.DataFormatVecPermutec                    |d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j                  t        j
                  gt        j                        \  }\  } | g}d|d|d|f}t        j                  dd||||      }t        j                         rt        j                  d	|||       |\  }|S )
Nr^   rd  ri  re  r%   s   DataFormatVecPermuters   rT   rt  rp  rq  s	            rQ   ru  ru    s    J  \:*J  \:*111#sW]]GMM<\^e^k^kl-'4A,,
L*M&4a#)s?'""$fg?('	.r\   TV_DepthwiseConv2dNative_Tc                    t         j                   xs t        j                         }|j                  }	|	j                  r&	 t	        j
                  |d|| |d|d|d|d|d|      }
|
S t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|g }t        |t        t        f      st!        d
|z        |D cg c]  }t#        j$                  |d       }}|d}t#        j&                  |d      }|g d}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t)        j*                  d| |||||||	      \  }}}}|dd }
t#        j,                         rd|j/                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y Rw xY wc c}w c c}w c c}w )a3	  Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors.

  Given an input tensor of shape `[batch, in_height, in_width, in_channels]`
  and a filter / kernel tensor of shape
  `[filter_height, filter_width, in_channels, channel_multiplier]`, containing
  `in_channels` convolutional filters of depth 1, `depthwise_conv2d` applies
  a different filter to each input channel (expanding from 1 channel to
  `channel_multiplier` channels for each), then concatenates the results
  together. Thus, the output has `in_channels * channel_multiplier` channels.

  ```
  for k in 0..in_channels-1
    for q in 0..channel_multiplier-1
      output[b, i, j, k * channel_multiplier + q] =
        sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *
                          filter[di, dj, k, q]
  ```

  Must have `strides[0] = strides[3] = 1`.  For the most common case of the same
  horizontal and vertices strides, `strides = [1, stride, stride, 1]`.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
    filter: A `Tensor`. Must have the same type as `input`.
    strides: A list of `ints`.
      1-D of length 4.  The stride of the sliding window for each dimension
      of `input`.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, height, width, channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, channels, height, width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      1-D tensor of length 4.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each filter
      element on that dimension. The dimension order is determined by the value of
      `data_format`, see above for details. Dilations in the batch and depth
      dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  DepthwiseConv2dNativerf   r`   r   ra   r   Nrf   r`   r   ra   r   r    r!   MExpected list for 'strides' argument to 'depthwise_conv2d_native' Op, not %r.WExpected list for 'explicit_paddings' argument to 'depthwise_conv2d_native' Op, not %r.r^   r   OExpected list for 'dilations' argument to 'depthwise_conv2d_native' Op, not %r.)r   r   rf   r`   r   ra   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   &depthwise_conv2d_native_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   )r   r   rf   r`   r   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                     rQ   depthwise_conv2d_nativer    s   ` 
			0h..0$#\\	11%tUFIG%8:K{K<g n 
GdE]	+
	029	:; ; 9@@"Xr9-@'@gy1'	%e}	5
	02C	DE E M^^bx((-@A^^K!!+}=+I	Ie}	-
	02;	<= = =FFbx  [1F)F'88uVW)03D-8I&*,!QX QK'""$3%%c*Ill9%y#,,y2I!3<<0C#DS\\-8+ll;'	)F
 ::Lvw@('	.i && -
##At,,## 
3
'-;Dd4 4 ## 
 A _ GsB    $I J;.K KJ	I00J	J	J! !J87J8zraw_ops.DepthwiseConv2dNativec	                    t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	|d}t	        j                  |d      }|g d}t        |t        t        f      st        d	|z        |D 	cg c]  }	t	        j
                  |	d
       }}	t	        j                  | |g|t        j                  t        j                  t        j                  t        j                  g      \  }
}|\  } }| |g}d|
d|d|d|d|d
|f}t	        j                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S c c}	w c c}	w c c}	w )Nr|  rf   r`   r}  r   r^   ra   r   r~  r   r%   s   DepthwiseConv2dNativers   rT   rz  rt   )r   r   rf   r`   r   ra   r   r    r!   ro   r[   r   rP   rO   rJ   s                  rQ   r  r  *  s   	GdE]	+
	029	:; ; 9@@"Xr9-@'@gy1'	%e}	5
	02C	DE E M^^bx((-@A^^K!!+}=+I	Ie}	-
	02;	<= = =FFbx  [1F)F66vgll\c\l\lnun}n}  @G  @O  @O  NR  S'9/5&,)Wi(-y& 5q#)s?'""$vw@('	.? A _ Gs   G
G1G(TV_DepthwiseConv2dNativeBackpropFilter_Tc	                    t         j                   xs t        j                         }	|	j                  }
|
j                  r'	 t	        j
                  |	d|| ||d|d|d|d|d|      }|S t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|g }t        |t        t        f      st!        d
|z        |D cg c]  }t#        j$                  |d       }}|d}t#        j&                  |d      }|g d}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t)        j*                  d| ||||||||
      \  }}}}|dd }t#        j,                         rd|j/                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	
      S # t        j                  $ r Y Tw xY wc c}w c c}w c c}w )a"  Computes the gradients of depthwise convolution with respect to the filter.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      4-D with shape based on `data_format`.  For example, if
      `data_format` is 'NHWC' then `input` is a 4-D `[batch, in_height,
      in_width, in_channels]` tensor.
    filter_sizes: A `Tensor` of type `int32`.
      An integer vector representing the tensor shape of `filter`,
      where `filter` is a 4-D
      `[filter_height, filter_width, in_channels, depthwise_multiplier]` tensor.
    out_backprop: A `Tensor`. Must have the same type as `input`.
      4-D with shape  based on `data_format`.
      For example, if `data_format` is 'NHWC' then
      out_backprop shape is `[batch, out_height, out_width, out_channels]`.
      Gradients w.r.t. the output of the convolution.
    strides: A list of `ints`.
      The stride of the sliding window for each dimension of the input
      of the convolution.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, height, width, channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, channels, height, width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      1-D tensor of length 4.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each filter
      element on that dimension. The dimension order is determined by the value of
      `data_format`, see above for details. Dilations in the batch and depth
      dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  #DepthwiseConv2dNativeBackpropFilterrf   r`   r   ra   r   Nr{  ]Expected list for 'strides' argument to 'depthwise_conv2d_native_backprop_filter' Op, not %r.gExpected list for 'explicit_paddings' argument to 'depthwise_conv2d_native_backprop_filter' Op, not %r.r^   r   _Expected list for 'dilations' argument to 'depthwise_conv2d_native_backprop_filter' Op, not %r.)	r   r   r   rf   r`   r   ra   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   6depthwise_conv2d_native_backprop_filter_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   )r   r   r   rf   r`   r   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                      rQ   'depthwise_conv2d_native_backprop_filterr  S  s   P 
			0h..0$#\\
113T5lIw	7.{Y	 g
 n 
GdE]	+
	@BI	JK K 9@@"Xr9-@'@gy1'	%e}	5
	@BS	TU U M^^bx((-@A^^K!!+}=+I	Ie}	-
	@BK	LM M =FFbx  [1F)F'88-U<H<H7>7>AR;F9BO!QX QK'""$3%%c*Ill9%y#,,y2I!3<<0C#DS\\-8+ll;'	)F
 ::L-|VWN('	.o && -
##At,,## 
C
|Wg-;Dd4 4 ## 
 A _ GB    %I J>/KKJI22J
JJ$ $J;:J;z+raw_ops.DepthwiseConv2dNativeBackpropFilterc
                     t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
|d}t	        j                  |d      }|g d}t        |t        t        f      st        d	|z        |D 
cg c]  }
t	        j
                  |
d
       }}
t	        j                  | |g|	t        j                  t        j                  t        j                  t        j                  g      \  }}|\  } }t        j                  |t        j                        }| ||g}d|d|d|d|d|d
|f}t	        j                   dd|||	|      }t	        j"                         rt	        j$                  d|||       |\  }|S c c}
w c c}
w c c}
w )Nr  rf   r`   r  r   r^   ra   r   r  r   r%   s#   DepthwiseConv2dNativeBackpropFilterrs   rT   r  r   )r   r   r   rf   r`   r   ra   r   r    r!   ro   r[   r   rP   rO   rJ   s                   rQ   r  r    sL   	GdE]	+
	@BI	JK K 9@@"Xr9-@'@gy1'	%e}	5
	@BS	TU U M^^bx((-@A^^K!!+}=+I	Ie}	-
	@BK	LM M =FFbx  [1F)F66|7LcT[T`T`bibrbrt{  uD  uD  FM  FU  FU  TX  Y'9#5,''gmmD,|4,)Wi(-y& CQ$0C"&(' ""$-|VWN('	.C A _ G   G1
G61G;'TV_DepthwiseConv2dNativeBackpropInput_Tc	                    t         j                   xs t        j                         }	|	j                  }
|
j                  r'	 t	        j
                  |	d|| ||d|d|d|d|d|      }|S t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|g }t        |t        t        f      st!        d
|z        |D cg c]  }t#        j$                  |d       }}|d}t#        j&                  |d      }|g d}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t)        j*                  d| ||||||||
      \  }}}}|dd }t#        j,                         rd|j/                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	
      S # t        j                  $ r Y Tw xY wc c}w c c}w c c}w )a  Computes the gradients of depthwise convolution with respect to the input.

  Args:
    input_sizes: A `Tensor` of type `int32`.
      An integer vector representing the shape of `input`, based
      on `data_format`.  For example, if `data_format` is 'NHWC' then
       `input` is a 4-D `[batch, height, width, channels]` tensor.
    filter: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      4-D with shape
      `[filter_height, filter_width, in_channels, depthwise_multiplier]`.
    out_backprop: A `Tensor`. Must have the same type as `filter`.
      4-D with shape  based on `data_format`.
      For example, if `data_format` is 'NHWC' then
      out_backprop shape is `[batch, out_height, out_width, out_channels]`.
      Gradients w.r.t. the output of the convolution.
    strides: A list of `ints`.
      The stride of the sliding window for each dimension of the input
      of the convolution.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, height, width, channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, channels, height, width].
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      1-D tensor of length 4.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each filter
      element on that dimension. The dimension order is determined by the value of
      `data_format`, see above for details. Dilations in the batch and depth
      dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `filter`.
  "DepthwiseConv2dNativeBackpropInputrf   r`   r   ra   r   Nr{  \Expected list for 'strides' argument to 'depthwise_conv2d_native_backprop_input' Op, not %r.fExpected list for 'explicit_paddings' argument to 'depthwise_conv2d_native_backprop_input' Op, not %r.r^   r   ^Expected list for 'dilations' argument to 'depthwise_conv2d_native_backprop_input' Op, not %r.)	r  r   r   rf   r`   r   ra   r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   5depthwise_conv2d_native_backprop_input_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   )r  r   r   rf   r`   r   ra   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                      rQ   &depthwise_conv2d_native_backprop_inputr    s   N 
			0h..0$#\\
112D+vi)W.{Y	 g
 n 
GdE]	+
	?AH	IJ J 9@@"Xr9-@'@gy1'	%e}	5
	?AR	ST T M^^bx((-@A^^K!!+}=+I	Ie}	-
	?AJ	KL L =FFbx  [1F)F'88,+5;;G6=6=@Q:E8AN!QX QK'""$3%%c*Ill9%y#,,y2I!3<<0C#DS\\-8+ll;'	)F
 ::L,lFGM('	.o && -
##At,,## 
B
v|Wg-;Dd4 4 ## 
 A _ Gr  z*raw_ops.DepthwiseConv2dNativeBackpropInputc
                     t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
|d}t	        j                  |d      }|g d}t        |t        t        f      st        d	|z        |D 
cg c]  }
t	        j
                  |
d
       }}
t	        j                  ||g|	t        j                  t        j                  t        j                  t        j                  g      \  }}|\  }}t        j                  | t        j                        } | ||g}d|d|d|d|d|d
|f}t	        j                   dd|||	|      }t	        j"                         rt	        j$                  d|||       |\  }|S c c}
w c c}
w c c}
w )Nr  rf   r`   r  r   r^   ra   r   r  r   r%   s"   DepthwiseConv2dNativeBackpropInputrs   rT   r  r   )r  r   r   rf   r`   r   ra   r   r    r!   ro   r[   r   rP   rO   rJ   s                   rQ   r  r  Y  sI   	GdE]	+
	?AH	IJ J 9@@"Xr9-@'@gy1'	%e}	5
	?AR	ST T M^^bx((-@A^^K!!+}=+I	Ie}	-
	?AJ	KL L =FFbx  [1F)F667MsU\UaUacjcscsu|  vE  vE  GN  GV  GV  UY  Z'9$6<&&{GMMB+v|4,)Wi(-y& BA$0C"&(' ""$,lFGM('	.C A _ Gr  TV_Dilation2D_Tc                 `   t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |d|d|d|      }|S t        |t        t        f      st!        d|z        |D 
cg c]  }
t#        j$                  |
d       }}
t        |t        t        f      st!        d|z        |D 
cg c]  }
t#        j$                  |
d       }}
t#        j&                  |d      }t)        j*                  d| |||||	      \  }}}}|dd }t#        j,                         rjd
|j/                  d
      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y w xY wc c}
w c c}
w )a:  Computes the grayscale dilation of 4-D `input` and 3-D `filter` tensors.

  The `input` tensor has shape `[batch, in_height, in_width, depth]` and the
  `filter` tensor has shape `[filter_height, filter_width, depth]`, i.e., each
  input channel is processed independently of the others with its own structuring
  function. The `output` tensor has shape
  `[batch, out_height, out_width, depth]`. The spatial dimensions of the output
  tensor depend on the `padding` algorithm. We currently only support the default
  "NHWC" `data_format`.

  In detail, the grayscale morphological 2-D dilation is the max-sum correlation
  (for consistency with `conv2d`, we use unmirrored filters):

      output[b, y, x, c] =
         max_{dy, dx} input[b,
                            strides[1] * y + rates[1] * dy,
                            strides[2] * x + rates[2] * dx,
                            c] +
                      filter[dy, dx, c]

  Max-pooling is a special case when the filter has size equal to the pooling
  kernel size and contains all zeros.

  Note on duality: The dilation of `input` by the `filter` is equal to the
  negation of the erosion of `-input` by the reflected `filter`.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      4-D with shape `[batch, in_height, in_width, depth]`.
    filter: A `Tensor`. Must have the same type as `input`.
      3-D with shape `[filter_height, filter_width, depth]`.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of the input
      tensor. Must be: `[1, stride_height, stride_width, 1]`.
    rates: A list of `ints` that has length `>= 4`.
      The input stride for atrous morphological dilation. Must be:
      `[1, rate_height, rate_width, 1]`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  
Dilation2Drf   ratesr`   Nrf   r  r`   r    r!   @Expected list for 'strides' argument to 'dilation2d' Op, not %r.>Expected list for 'rates' argument to 'dilation2d' Op, not %r.)r   r   rf   r  r`   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   dilation2d_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   )r   r   rf   r  r`   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                   rQ   
dilation2dr    s>   Z 
			0h..0$#\\11lD%GWy'#g n 
GdE]	+
	#%,	-. . 9@@"Xr9-@'@	ED%=	)
	#%*	+, , 5:
:b8R)
:%
:gy1''88E&'!7?!QX QK'""$3%%c*Ill9%wW0Ei02F ::LlFG5('	.E && -
##At,,## 
&
w  ## 
 A
 ;s<     F/ 	H&H+/G6GG65G6:H H#"H#zraw_ops.Dilation2Dc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }t	        j                  | |g|t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  g      \  }}	|	\  } }| |g}
d|d|d|d|f}t	        j*                  dd|
|||	      }t	        j,                         rt	        j.                  d
|
||       |\  }|S c c}w c c}w )Nr  rf   r  r  r`   r%   s
   Dilation2Drs   rT   r  rk   rl   rm   r5   r;   r<   rn   rV   rW   rZ   ru   r   r   r   r   r   rY   r   rX   r   r   r   rA   rG   )r   r   rf   r  r`   r    r!   ro   r[   r   rP   rO   rJ   s                rQ   r  r    s%   	GdE]	+
	#%,	-. . 9@@"Xr9-@'@	ED%=	)
	#%*	+, , 5:
:b8R)
:%
:gy1'66vgoo_f_n_npwp}p}  @G  @M  @M  OV  O\  O\  ^e  ^j  ^j  ls  ly  ly  {B  {K  {K  MT  M[  M[  ]d  ]i  ]i  kr  ky  ky  {B  {I  {I  NL  M'9/5&,)Wgui	&]Al#)s?'""$lFG5('	.% A
 ;   G0GTV_Dilation2DBackpropFilter_Tc                 f   t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| ||d|d|d|      }	|	S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }t)        j*                  d| ||||||	      \  }}}}|dd }	t#        j,                         rjd
|j/                  d
      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w c c}w )a  Computes the gradient of morphological 2-D dilation with respect to the filter.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      4-D with shape `[batch, in_height, in_width, depth]`.
    filter: A `Tensor`. Must have the same type as `input`.
      3-D with shape `[filter_height, filter_width, depth]`.
    out_backprop: A `Tensor`. Must have the same type as `input`.
      4-D with shape `[batch, out_height, out_width, depth]`.
    strides: A list of `ints` that has length `>= 4`.
      1-D of length 4. The stride of the sliding window for each dimension of
      the input tensor. Must be: `[1, stride_height, stride_width, 1]`.
    rates: A list of `ints` that has length `>= 4`.
      1-D of length 4. The input stride for atrous morphological dilation.
      Must be: `[1, rate_height, rate_width, 1]`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Dilation2DBackpropFilterrf   r  r`   Nr  PExpected list for 'strides' argument to 'dilation2d_backprop_filter' Op, not %r.NExpected list for 'rates' argument to 'dilation2d_backprop_filter' Op, not %r.r   r   r   rf   r  r`   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   )dilation2d_backprop_filter_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   r   r   r   rf   r  r`   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                    rQ   dilation2d_backprop_filterr    sI   . 
			0h..0$#\\11($v|7GUIw@g n 
GdE]	+
	35<	=> > 9@@"Xr9-@'@	ED%=	)
	35:	;< < 5:
:b8R)
:%
:gy1''88"%1=,35,3$	@!QX
 QK'""$3%%c*Ill9%wW0Ei02F ::L"L&'C('	.I && -
##At,,## 
6
we$0 0 ## 
 A
 ;<    !F1 
H)H.1G8GG87G8<H H&%H&z raw_ops.Dilation2DBackpropFilterc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }t	        j                  | ||g|t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  g      \  }	}
|
\  } }}| ||g}d|	d|d|d|f}t	        j*                  dd||||	      }t	        j,                         rt	        j.                  d
|||       |\  }|S c c}w c c}w )Nr  rf   r  r  r`   r%   s   Dilation2DBackpropFilterrs   rT   r  r  r   r   r   rf   r  r`   r    r!   ro   r[   r   rP   rO   rJ   s                 rQ   r  r  D  sC   	GdE]	+
	35<	=> > 9@@"Xr9-@'@	ED%=	)
	35:	;< < 5:
:b8R)
:%
:gy1'66v|7TVY\c\k\kmtm|m|  F  L  L  NU  N[  N[  ]d  ]j  ]j  ls  lx  lx  zA  zG  zG  IP  IY  IY  [b  [i  [i  kr  kw  kw  y@  yG  yG  IP  IW  IW  \Z  ['9"+5&,.,)Wgui	&8!$0C"&(' ""$"L&'C('	.' A
 ;   G0GTV_Dilation2DBackpropInput_Tc                 f   t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| ||d|d|d|      }	|	S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }t)        j*                  d| ||||||	      \  }}}}|dd }	t#        j,                         rjd
|j/                  d
      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w c c}w )a  Computes the gradient of morphological 2-D dilation with respect to the input.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      4-D with shape `[batch, in_height, in_width, depth]`.
    filter: A `Tensor`. Must have the same type as `input`.
      3-D with shape `[filter_height, filter_width, depth]`.
    out_backprop: A `Tensor`. Must have the same type as `input`.
      4-D with shape `[batch, out_height, out_width, depth]`.
    strides: A list of `ints` that has length `>= 4`.
      1-D of length 4. The stride of the sliding window for each dimension of
      the input tensor. Must be: `[1, stride_height, stride_width, 1]`.
    rates: A list of `ints` that has length `>= 4`.
      1-D of length 4. The input stride for atrous morphological dilation.
      Must be: `[1, rate_height, rate_width, 1]`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  Dilation2DBackpropInputrf   r  r`   Nr  OExpected list for 'strides' argument to 'dilation2d_backprop_input' Op, not %r.MExpected list for 'rates' argument to 'dilation2d_backprop_input' Op, not %r.r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   (dilation2d_backprop_input_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   r  s                    rQ   dilation2d_backprop_inputr  a  sH   . 
			0h..0$#\\11'ufl7GUIw@g n 
GdE]	+
	24;	<= = 9@@"Xr9-@'@	ED%=	)
	249	:; ; 5:
:b8R)
:%
:gy1''88!v0<g).dL!QX QK'""$3%%c*Ill9%wW0Ei02F ::L!<B('	.G && -
##At,,## 
5
we$0 0 ## 
 A
 ;r  zraw_ops.Dilation2DBackpropInputc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }t	        j                  | ||g|t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  g      \  }	}
|
\  } }}| ||g}d|	d|d|d|f}t	        j*                  dd||||	      }t	        j,                         rt	        j.                  d
|||       |\  }|S c c}w c c}w )Nr  rf   r  r  r`   r%   s   Dilation2DBackpropInputrs   rT   r  r  r  s                 rQ   r  r    sC   	GdE]	+
	24;	<= = 9@@"Xr9-@'@	ED%=	)
	249	:; ; 5:
:b8R)
:%
:gy1'66v|7TVY\c\k\kmtm|m|  F  L  L  NU  N[  N[  ]d  ]j  ]j  ls  lx  lx  zA  zG  zG  IP  IY  IY  [b  [i  [i  kr  kw  kw  y@  yG  yG  IP  IW  IW  \Z  ['9"+5&,.,)Wgui	&7$0C"&(' ""$!<B('	.' A
 ;r  TV_Elu_Tznn.elufeaturesc           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)a  Computes the exponential linear function.

  The ELU function is defined as:

   * $ e ^ x - 1 $ if $ x < 0 $
   * $ x $ if $ x >= 0 $

  Examples:

  >>> tf.nn.elu(1.0)
  <tf.Tensor: shape=(), dtype=float32, numpy=1.0>
  >>> tf.nn.elu(0.0)
  <tf.Tensor: shape=(), dtype=float32, numpy=0.0>
  >>> tf.nn.elu(-1000.0)
  <tf.Tensor: shape=(), dtype=float32, numpy=-1.0>

  See [Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)
  ](http://arxiv.org/abs/1511.07289)

  Args:
    features: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `features`.
  EluNr   r"   r  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   _dispatcher_for_elur2   elu_eager_fallbackr4   r5   r6   r7   r   elur8   r9   r:   r?   r@   r;   rA   rE   rF   rG   r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s              rQ   r  r    s   < 
			0h..0$#\\11eT8%gn, "	44!Gn$n	
)::t-Aq#x QK'""$3%%c*+F::L|VW.('	.W && -
##At,,## 
#T
T#g		&
4) )## 
z" ""T8$7g 
	..<<	<  Z	  
  
r45
G i,,:::n	
P    C& 3G &D-9DD-,D-1E 	E G,AG GAHHzraw_ops.Eluc                 \   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  g      \  }\  } | g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   Elurs   rT   r  
r;   rV   rW   rX   rY   rZ   ru   r   rA   rG   r  r    r!   r[   rP   rO   rJ   s          rQ   r  r    s    !88(S7<<Y`YiYikrkzkz  }D  }L  }L  KO  P';H,>&VQ|6!$41'""$|VW.('	.r\   TV_EluGrad_T	gradientsoutputsc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        j                  d| ||      \  }}}}	|	dd }t        j                          r7d|j#                  d      f}
|j$                  }t        j&                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a  Computes gradients for the exponential linear (Elu) operation.

  Args:
    gradients: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      The backpropagated gradients to the corresponding Elu operation.
    outputs: A `Tensor`. Must have the same type as `gradients`.
      The outputs of the corresponding Elu operation.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `gradients`.
  EluGradNr   r  r  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   elu_grad_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s               rQ   elu_gradr  *  s>    
			0h..0$#\\11iy'3gn (88YdD!QXQK'""$3%%c*+F::L<2('	.' && -
##At,,## 
$
W4T3 3## 
r   zraw_ops.EluGradc                 f   t        j                  | |g|t        j                  t        j                  t        j
                  t        j                  g      \  }}|\  } }| |g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   EluGradrs   rT   r  r  	r  r  r    r!   r[   r   rP   rO   rJ   s	            rQ   r  r  V  s    66	77KSSZS_S_ahaqaqsz  tC  tC  EL  ET  ET  SW  X'9"9gW%,>&Z<v!$41'""$<2('	.r\   FractionalAvgPool)outputrow_pooling_sequencecol_pooling_sequenceTV_FractionalAvgPool_TFpseudo_randomoverlappingdeterministicseedseed2c                 d   t         j                   xs t        j                         }|j                  }	|	j                  r<	 t	        j
                  |d|| d|d|d|d|d|d|      }
t        j                  |
      }
|
S t        |t         t"        f      st%        d
|z        |D cg c]  }t'        j(                  |d       }}|d}t'        j*                  |d      }|d}t'        j*                  |d      }|d}t'        j*                  |d      }|d}t'        j,                  |d      }|d}t'        j,                  |d      }t/        j0                  d| |||||||	      \  }}}}|dd }
t'        j2                         rd|j5                  d      d|j7                  d      d|j7                  d      d|j7                  d      d|j9                  d      d|j9                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||
       t        j                  |
      }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||		      S # t        j                  $ r Y .w xY wc c}w )a	  Performs fractional average pooling on the input.

  Fractional average pooling is similar to Fractional max pooling in the pooling
  region generation step. The only difference is that after pooling regions are
  generated, a mean operation is performed instead of a max operation in each
  pooling region.

  Args:
    value: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
      4-D with shape `[batch, height, width, channels]`.
    pooling_ratio: A list of `floats` that has length `>= 4`.
      Pooling ratio for each dimension of `value`, currently only
      supports row and col dimension and should be >= 1.0. For example, a valid
      pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements
      must be 1.0 because we don't allow pooling on batch and channels
      dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions
      respectively.
    pseudo_random: An optional `bool`. Defaults to `False`.
      When set to True, generates the pooling sequence in a
      pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin
      Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for
      difference between pseudorandom and random.
    overlapping: An optional `bool`. Defaults to `False`.
      When set to True, it means when pooling, the values at the boundary
      of adjacent pooling cells are used by both cells. For example:

      `index  0  1  2  3  4`

      `value  20 5  16 3  7`

      If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice.
      The result would be [41/3, 26/3] for fractional avg pooling.
    deterministic: An optional `bool`. Defaults to `False`.
      When set to True, a fixed pooling region will be used when
      iterating over a FractionalAvgPool node in the computation graph. Mainly used
      in unit test to make FractionalAvgPool deterministic.
    seed: An optional `int`. Defaults to `0`.
      If either seed or seed2 are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      An second seed to avoid seed collision.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, row_pooling_sequence, col_pooling_sequence).

    output: A `Tensor`. Has the same type as `value`.
    row_pooling_sequence: A `Tensor` of type `int64`.
    col_pooling_sequence: A `Tensor` of type `int64`.
  r  pooling_ratior  r  r  r  r  Nr  r  r  r  r  r  r    r!   OExpected list for 'pooling_ratio' argument to 'fractional_avg_pool' Op, not %r.Fr   r_   r  r  r  r  r  r  r    r%   ) r&   r   r'   r(   r   r)   _FractionalAvgPoolOutputr+   r,   r-   r.   r/   r0   "fractional_avg_pool_eager_fallbackr4   rk   rl   rm   r5   r;   r=   r>   r<   r?   r@   rA   rC   rD   rB   rE   rF   rG   r_   r  r  r  r  r  r  r    rH   rI   rJ   rK   _frL   rM   rN   rO   rP   s                     rQ   fractional_avg_poolr  j  s   h 
			0h..0$#\\11!4}_mVT7	g
 )..w7gn 
MD%=	1
	,.;	<= = GTT8&&r?;T-TM$$]OD-K"";>+M$$]OD-	\D			4	($
]E


E7
+%'885+8)4+8t#(t5!QX QK'""$s||O<o  1=  /  16'#2C2CG2L3%%c*,F ::L\67<$**73'	.e && -
##At,,## 
/
}M!TDd, , ## 
 U6    :H4 #J-4I;I""I;:I;?J J*)J*zraw_ops.FractionalAvgPoolc	                 2   t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	|d}t	        j                  |d      }|d}t	        j                  |d      }|d}t	        j                  |d      }|d}t	        j                  |d      }|d}t	        j                  |d	      }t	        j                  | g|t        j                  t        j                  t        j                  t        j                  g      \  }
\  } | g}d|d|d|d|d|d	|d
|
f}t	        j                  dd||||      }t	        j                         rt	        j                   d|||       t"        j%                  |      }|S c c}	w )Nr  r  Fr  r  r  r   r  r  r%   s   FractionalAvgPool   rT   r  )rk   rl   rm   r5   r;   r=   r>   r<   rV   rW   rZ   ru   r   r   r   rA   rG   r  r+   r_   r  r  r  r  r  r  r    r!   r  r[   rP   rO   rJ   s                 rQ   r  r       	MD%=	1
	,.;	<= = GTT8&&r?;T-TM$$]OD-K"";>+M$$]OD-	\D			4	($
]E


E7
+%55ugsW__V]VeVegngtgtv}  wD  wD  EG  H'8E,]O]o}fd	5#w & 11\#)s?'""$\67<$**73'	.7 U   FTV_FractionalAvgPoolGrad_Torig_input_tensor_shaper  r  c                    t         j                   xs t        j                         }|j                  }|j                  r 	 t	        j
                  |d|| |||d|	      }|S |d}t        j                  |d      }t        j                   d| |||||      \  }
}
}}|dd }t        j"                         rHd|j%                  d      d|j'                  d      f}|j(                  }t        j*                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y w xY w)a  Computes gradient of the FractionalAvgPool function.

  Unlike FractionalMaxPoolGrad, we don't need to find arg_max for
  FractionalAvgPoolGrad, we just need to evenly back-propagate each element of
  out_backprop to those indices that form the same pooling cell. Therefore, we
  just need to know the shape of original input tensor, instead of the whole
  tensor.

  Args:
    orig_input_tensor_shape: A `Tensor` of type `int64`.
      Original input tensor shape for `fractional_avg_pool`
    out_backprop: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
      4-D with shape `[batch, height, width, channels]`.  Gradients
      w.r.t. the output of `fractional_avg_pool`.
    row_pooling_sequence: A `Tensor` of type `int64`.
      row pooling sequence, form pooling region with
      col_pooling_sequence.
    col_pooling_sequence: A `Tensor` of type `int64`.
      column pooling sequence, form pooling region with
      row_pooling sequence.
    overlapping: An optional `bool`. Defaults to `False`.
      When set to True, it means when pooling, the values at the boundary
      of adjacent pooling cells are used by both cells. For example:

      `index  0  1  2  3  4`

      `value  20 5  16 3  7`

      If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice.
      The result would be [41/3, 26/3] for fractional avg pooling.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `out_backprop`.
  FractionalAvgPoolGradr  Nr  r    r!   F)r  r   r  r  r  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   'fractional_avg_pool_grad_eager_fallbackr4   r;   r>   r?   r@   rA   rD   rE   rF   rG   )r  r   r  r  r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                  rQ   fractional_avg_pool_gradr    s   H 
			0h..0$#\\	11%t-D*,@{$g n K"";>+'889P.:6J6J-8tE!QX QK'""$S//>  %'F::Lvw@('	.9 && -
##At,,## 
4
!<1E
KdN N ## 
s0    D ED//EEE E54E5zraw_ops.FractionalAvgPoolGradc                 r   |d}t        j                  |d      }t        j                  |g|t        j                  t        j
                  t        j                  t        j                  g      \  }\  }t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }| |||g}d|d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d||	|
       |
\  }
|
S )NFr  r%   s   FractionalAvgPoolGradrs   rT   r  r;   r>   rV   rW   rZ   ru   r   r   r.   r   r   rA   rG   )r  r   r  r  r  r    r!   r[   rP   rO   rJ   s              rQ   r  r  S  s0   K"";>+%<<l^SSZSbSbdkdsdsu|  vC  vC  EL  ER  ER  SU  V'?L 223JGMMZ//0DgmmT//0DgmmT)<9MOcd,;W5&5q#)s?'""$vw@('	.r\   FractionalMaxPoolTV_FractionalMaxPool_Tc                 d   t         j                   xs t        j                         }|j                  }	|	j                  r<	 t	        j
                  |d|| d|d|d|d|d|d|      }
t        j                  |
      }
|
S t        |t         t"        f      st%        d
|z        |D cg c]  }t'        j(                  |d       }}|d}t'        j*                  |d      }|d}t'        j*                  |d      }|d}t'        j*                  |d      }|d}t'        j,                  |d      }|d}t'        j,                  |d      }t/        j0                  d| |||||||	      \  }}}}|dd }
t'        j2                         rd|j5                  d      d|j7                  d      d|j7                  d      d|j7                  d      d|j9                  d      d|j9                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||
       t        j                  |
      }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||		      S # t        j                  $ r Y .w xY wc c}w )av  Performs fractional max pooling on the input.

  Fractional max pooling is slightly different than regular max pooling.  In
  regular max pooling, you downsize an input set by taking the maximum value of
  smaller N x N subsections of the set (often 2x2), and try to reduce the set by
  a factor of N, where N is an integer.  Fractional max pooling, as you might
  expect from the word "fractional", means that the overall reduction ratio N
  does not have to be an integer.

  The sizes of the pooling regions are generated randomly but are fairly uniform.
  For example, let's look at the height dimension, and the constraints on the
  list of rows that will be pool boundaries.

  First we define the following:

  1.  input_row_length : the number of rows from the input set
  2.  output_row_length : which will be smaller than the input
  3.  alpha = input_row_length / output_row_length : our reduction ratio
  4.  K = floor(alpha)
  5.  row_pooling_sequence : this is the result list of pool boundary rows

  Then, row_pooling_sequence should satisfy:

  1.  a[0] = 0 : the first value of the sequence is 0
  2.  a[end] = input_row_length : the last value of the sequence is the size
  3.  K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size
  4.  length(row_pooling_sequence) = output_row_length+1

  For more details on fractional max pooling, see this paper:
  [Benjamin Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071)

  Args:
    value: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
      4-D with shape `[batch, height, width, channels]`.
    pooling_ratio: A list of `floats` that has length `>= 4`.
      Pooling ratio for each dimension of `value`, currently only
      supports row and col dimension and should be >= 1.0. For example, a valid
      pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements
      must be 1.0 because we don't allow pooling on batch and channels
      dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions
      respectively.
    pseudo_random: An optional `bool`. Defaults to `False`.
      When set to True, generates the pooling sequence in a
      pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin
      Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for
      difference between pseudorandom and random.
    overlapping: An optional `bool`. Defaults to `False`.
      When set to True, it means when pooling, the values at the boundary
      of adjacent pooling cells are used by both cells. For example:

      `index  0  1  2  3  4`

      `value  20 5  16 3  7`

      If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice.
      The result would be [20, 16] for fractional max pooling.
    deterministic: An optional `bool`. Defaults to `False`.
      When set to True, a fixed pooling region will be used when
      iterating over a FractionalMaxPool node in the computation graph. Mainly used
      in unit test to make FractionalMaxPool deterministic.
    seed: An optional `int`. Defaults to `0`.
      If either seed or seed2 are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      An second seed to avoid seed collision.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, row_pooling_sequence, col_pooling_sequence).

    output: A `Tensor`. Has the same type as `value`.
    row_pooling_sequence: A `Tensor` of type `int64`.
    col_pooling_sequence: A `Tensor` of type `int64`.
  r  r  r  r  r  r  r  Nr  OExpected list for 'pooling_ratio' argument to 'fractional_max_pool' Op, not %r.Fr   r  r%   ) r&   r   r'   r(   r   r)   _FractionalMaxPoolOutputr+   r,   r-   r.   r/   r0   "fractional_max_pool_eager_fallbackr4   rk   rl   rm   r5   r;   r=   r>   r<   r?   r@   rA   rC   rD   rB   rE   rF   rG   r  s                     rQ   fractional_max_poolr  l  s   X 
			0h..0$#\\11!4}_mVT7	g
 )..w7gn 
MD%=	1
	,.;	<= = GTT8&&r?;T-TM$$]OD-K"";>+M$$]OD-	\D			4	($
]E


E7
+%'885+8)4+8t#(t5!QX QK'""$s||O<o  1=  /  16'#2C2CG2L3%%c*,F ::L\67<$**73'	.e && -
##At,,## 
/
}M!TDd, , ## 
 Ur  zraw_ops.FractionalMaxPoolc	                 2   t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	|d}t	        j                  |d      }|d}t	        j                  |d      }|d}t	        j                  |d      }|d}t	        j                  |d      }|d}t	        j                  |d	      }t	        j                  | g|t        j                  t        j                  t        j                  t        j                  g      \  }
\  } | g}d|d|d|d|d|d	|d
|
f}t	        j                  dd||||      }t	        j                         rt	        j                   d|||       t"        j%                  |      }|S c c}	w )Nr  r  Fr  r  r  r   r  r  r%   s   FractionalMaxPoolr  rT   r  )rk   rl   rm   r5   r;   r=   r>   r<   rV   rW   rZ   ru   r   r   r   rA   rG   r  r+   r  s                 rQ   r  r    r  r  TV_FractionalMaxPoolGrad_T
orig_inputorig_outputc                    t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| ||||d|
      }	|	S |d}t        j                  |d      }t        j                   d| ||||||      \  }}}}|dd }	t        j"                         rHd|j%                  d      d|j'                  d      f}|j(                  }t        j*                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY w)a"  Computes gradient of the FractionalMaxPool function.

  Args:
    orig_input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
      Original input for `fractional_max_pool`
    orig_output: A `Tensor`. Must have the same type as `orig_input`.
      Original output for `fractional_max_pool`
    out_backprop: A `Tensor`. Must have the same type as `orig_input`.
      4-D with shape `[batch, height, width, channels]`.  Gradients
      w.r.t. the output of `fractional_max_pool`.
    row_pooling_sequence: A `Tensor` of type `int64`.
      row pooling sequence, form pooling region with
      col_pooling_sequence.
    col_pooling_sequence: A `Tensor` of type `int64`.
      column pooling sequence, form pooling region with
      row_pooling sequence.
    overlapping: An optional `bool`. Defaults to `False`.
      When set to True, it means when pooling, the values at the boundary
      of adjacent pooling cells are used by both cells. For example:

      `index  0  1  2  3  4`

      `value  20 5  16 3  7`

      If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice.
      The result would be [20, 16] for fractional max pooling.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `orig_input`.
  FractionalMaxPoolGradr  Nr  F)r  r  r   r  r  r  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   'fractional_max_pool_grad_eager_fallbackr4   r;   r>   r?   r@   rA   rD   rE   rF   rG   )r  r  r   r  r  r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                   rQ   fractional_max_pool_gradr     s   @ 
			0h..0$#\\	11%tZ*,@{$g n K"";>+'88J-8.:6J6J-8tE!QX QK'""$S//>  %'F::Lvw@('	.; && -
##At,,## 
4
k<1E
KdN N ## 
s0    D E
D11E
	E
E! !E87E8zraw_ops.FractionalMaxPoolGradc                 8   |d}t        j                  |d      }t        j                  | ||g|t        j                  t        j
                  t        j                  t        j                  g      \  }}	|	\  } }}t        j                  |t        j                        }t        j                  |t        j                        }| ||||g}
d|d|f}t        j                  dd|
|||      }t        j                         rt        j                  d|
||       |\  }|S )NFr  r%   s   FractionalMaxPoolGradrs   rT   r  r  )r  r  r   r  r  r  r    r!   r[   r   rP   rO   rJ   s                rQ   r  r  j  s7   K"";>+66
KQ]7^`cfmfufuw~  xG  xG  IP  IV  IV  X_  Xe  Xe  fh  i'9,5):{L//0DgmmT//0DgmmTk<9MOcd,;W5&5q#)s?'""$vw@('	.r\   FusedBatchNorm)y
batch_meanbatch_variancereserve_space_1reserve_space_2TV_FusedBatchNorm_T)boundscaleoffsetmeanvarianceepsilonexponential_avg_factoris_trainingc
                 \   t         j                   xs t        j                         }
|
j                  }|j                  r<	 t	        j
                  |
d|	| ||||d|d|d|d|      }t        j                  |      }|S |d}t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d}t        j$                  |d      }t'        j(                  d| |||||||||	      \  }}}}|dd }t        j*                         r{d|j-                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t        j4                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||	       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
      S # t        j                  $ r Y w xY w)a  Batch normalization.

  Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW".
  The size of 1D Tensors matches the dimension C of the 4D Tensors.

  Args:
    x: A `Tensor`. Must be one of the following types: `float32`.
      A 4D Tensor for input data.
    scale: A `Tensor`. Must have the same type as `x`.
      A 1D Tensor for scaling factor, to scale the normalized x.
    offset: A `Tensor`. Must have the same type as `x`.
      A 1D Tensor for offset, to shift to the normalized x.
    mean: A `Tensor`. Must have the same type as `x`.
      A 1D Tensor for population mean. Used for inference only;
      must be empty for training.
    variance: A `Tensor`. Must have the same type as `x`.
      A 1D Tensor for population variance. Used for inference only;
      must be empty for training.
    epsilon: An optional `float`. Defaults to `0.0001`.
      A small float number added to the variance of x.
    exponential_avg_factor: An optional `float`. Defaults to `1`.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      The data format for x and y. Either "NHWC" (default) or "NCHW".
    is_training: An optional `bool`. Defaults to `True`.
      A bool value to indicate the operation is for training (default)
      or inference.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (y, batch_mean, batch_variance, reserve_space_1, reserve_space_2).

    y: A `Tensor`. Has the same type as `x`.
    batch_mean: A `Tensor`. Has the same type as `x`.
    batch_variance: A `Tensor`. Has the same type as `x`.
    reserve_space_1: A `Tensor`. Has the same type as `x`.
    reserve_space_2: A `Tensor`. Has the same type as `x`.
  r  r  r  ra   r  Nr  r  ra   r  r    r!   -C6?rs   r^   T
rc  r
  r  r  r  r  r  ra   r  r    r%   )r&   r   r'   r(   r   r)   _FusedBatchNormOutputr+   r,   r-   r.   r/   r0    _fused_batch_norm_eager_fallbackr4   r;   r=   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   rc  r
  r  r  r  r  r  ra   r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                      rQ   _fused_batch_normr    sT   L 
			0h..0$#\\
11ah746L{M;@g &++G4gn _G3'##../EG_`K!!+}=+K"";>+'88AU6#+W1G&1{#%!QX QK'""$3%%c*Ill9%'?ll34mll=)=  /	1F
 ::L,9!''0'	.U && -
##At,,## 
-
UFD(G!7!{	 
 ## 
s0    :F3 3G:G!!G:9G:>H H+*H+zraw_ops.FusedBatchNormc           
          |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | ||||g|
t
        j                  g      \  }}|\  } }}}}| ||||g}d	|d|d|d|d|f
}t        j                  d
d|||
|	      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr  r  rs   r  r^   ra   Tr  r%   s   FusedBatchNormr   rT   r  )r;   r=   rn   r>   rV   rW   rZ   r   rA   rG   r  r+   )rc  r
  r  r  r  r  r  ra   r  r    r!   r[   r   rP   rO   rJ   s                   rQ   r  r    s@   _G3'##../EG_`K!!+}=+K"";>+665&$PX7Y[^ahapap`st'9'0$1eVT8UFD(3,)W.F-m& .,#)s?'""$,9!''0'	.r\   FusedBatchNormGrad)
x_backpropscale_backpropoffset_backpropreserve_space_3reserve_space_4TV_FusedBatchNormGrad_T
y_backpropr  r  c	                    t         j                   xs t        j                         }	|	j                  }
|
j                  r:	 t	        j
                  |	d|| ||||d|d|d|      }t        j                  |      }|S |d}t        j                   |d      }|d}t        j"                  |d      }|d	}t        j$                  |d      }t'        j(                  d| ||||||||

      \  }}}}|dd }t        j*                         rjd|j-                  d      d|j/                  d      d|j/                  d      d|j1                  d      f}|j2                  }t        j4                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	
      S # t        j                  $ r Y w xY w)a  Gradient for batch normalization.

  Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW".
  The size of 1D Tensors matches the dimension C of the 4D Tensors.

  Args:
    y_backprop: A `Tensor`. Must be one of the following types: `float32`.
      A 4D Tensor for the gradient with respect to y.
    x: A `Tensor`. Must have the same type as `y_backprop`.
      A 4D Tensor for input data.
    scale: A `Tensor`. Must have the same type as `y_backprop`.
      A 1D Tensor for scaling factor, to scale the normalized x.
    reserve_space_1: A `Tensor`. Must have the same type as `y_backprop`.
      When is_training is True, a 1D Tensor for the computed batch
      mean to be reused in gradient computation. When is_training is
      False, a 1D Tensor for the population mean to be reused in both
      1st and 2nd order gradient computation.
    reserve_space_2: A `Tensor`. Must have the same type as `y_backprop`.
      When is_training is True, a 1D Tensor for the computed batch
      variance (inverted variance in the cuDNN case) to be reused in
      gradient computation. When is_training is False, a 1D Tensor
      for the population variance to be reused in both 1st and 2nd
      order gradient computation.
    epsilon: An optional `float`. Defaults to `0.0001`.
      A small float number added to the variance of x.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      The data format for y_backprop, x, x_backprop.
      Either "NHWC" (default) or "NCHW".
    is_training: An optional `bool`. Defaults to `True`.
      A bool value to indicate the operation is for training (default)
      or inference.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (x_backprop, scale_backprop, offset_backprop, reserve_space_3, reserve_space_4).

    x_backprop: A `Tensor`. Has the same type as `y_backprop`.
    scale_backprop: A `Tensor`. Has the same type as `y_backprop`.
    offset_backprop: A `Tensor`. Has the same type as `y_backprop`.
    reserve_space_3: A `Tensor`. Has the same type as `y_backprop`.
    reserve_space_4: A `Tensor`. Has the same type as `y_backprop`.
  r  r  ra   r  Nr  ra   r  r    r!   r  r^   T	r!  rc  r
  r  r  r  ra   r  r    r%   )r&   r   r'   r(   r   r)   _FusedBatchNormGradOutputr+   r,   r-   r.   r/   r0   $fused_batch_norm_grad_eager_fallbackr4   r;   r=   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   r!  rc  r
  r  r  r  ra   r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                     rQ   fused_batch_norm_gradr(    s   V 
			0h..0$#\\
11"D*a)Wm]K1g *//8gn _G3'K!!+}=+K"";>+'88q.=.=&-;*5DB!QX QK'""$3%%c*Ill9%}ll=)=  /1F ::LlFG=%++G4'	.K && -
##At,,## 
1
a{  ## 
s0    8F GF33GGG% %G<;G<zraw_ops.FusedBatchNormGradc
                    |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | ||||g|	t
        j                  g      \  }
}|\  } }}}}| ||||g}d|
d|d|d|f}t        j                  dd	|||	|
      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr  r  r^   ra   Tr  r%   s   FusedBatchNormGradr   rT   r  )r;   r=   rn   r>   rV   rW   rZ   r   rA   rG   r%  r+   )r!  rc  r
  r  r  r  ra   r  r    r!   r[   r   rP   rO   rJ   s                  rQ   r&  r&  c  s&   _G3'K!!+}=+K"";>+66
Auo_n7oqtw~  xG  xG  wJ  K'9=F::q%/aI,)Wm[&2Al#)s?'""$lFG=%++G4'	.r\   FusedBatchNormGradV2TV_FusedBatchNormGradV2_TTV_FusedBatchNormGradV2_Uc	                     t         j                   xs t        j                         }	|	j                  }
|
j                  r:	 t	        j
                  |	d|| ||||d|d|d|      }t        j                  |      }|S |d}t        j                   |d      }|d}t        j"                  |d      }|d	}t        j$                  |d      }t'        j(                  d| ||||||||

      \  }}}}|dd }t        j*                         r{d|j-                  d      d|j-                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t        j4                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	
      S # t        j                  $ r Y w xY w)a  Gradient for batch normalization.

  Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW".
  The size of 1D Tensors matches the dimension C of the 4D Tensors.

  Args:
    y_backprop: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      A 4D Tensor for the gradient with respect to y.
    x: A `Tensor`. Must have the same type as `y_backprop`.
      A 4D Tensor for input data.
    scale: A `Tensor` of type `float32`.
      A 1D Tensor for scaling factor, to scale the normalized x.
    reserve_space_1: A `Tensor`. Must be one of the following types: `float32`.
      When is_training is True, a 1D Tensor for the computed batch
      mean to be reused in gradient computation. When is_training is
      False, a 1D Tensor for the population mean to be reused in both
      1st and 2nd order gradient computation.
    reserve_space_2: A `Tensor`. Must have the same type as `reserve_space_1`.
      When is_training is True, a 1D Tensor for the computed batch
      variance (inverted variance in the cuDNN case) to be reused in
      gradient computation. When is_training is False, a 1D Tensor
      for the population variance to be reused in both 1st and 2nd
      order gradient computation.
    epsilon: An optional `float`. Defaults to `0.0001`.
      A small float number added to the variance of x.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      The data format for y_backprop, x, x_backprop.
      Either "NHWC" (default) or "NCHW".
    is_training: An optional `bool`. Defaults to `True`.
      A bool value to indicate the operation is for training (default)
      or inference.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (x_backprop, scale_backprop, offset_backprop, reserve_space_3, reserve_space_4).

    x_backprop: A `Tensor`. Has the same type as `y_backprop`.
    scale_backprop: A `Tensor`. Has the same type as `reserve_space_1`.
    offset_backprop: A `Tensor`. Has the same type as `reserve_space_1`.
    reserve_space_3: A `Tensor`. Has the same type as `reserve_space_1`.
    reserve_space_4: A `Tensor`. Has the same type as `reserve_space_1`.
  r*  r  ra   r  Nr#  r  r^   Tr$  r%   U)r&   r   r'   r(   r   r)   _FusedBatchNormGradV2Outputr+   r,   r-   r.   r/   r0   'fused_batch_norm_grad_v2_eager_fallbackr4   r;   r=   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   r'  s                     rQ   fused_batch_norm_grad_v2r1    s'   V 
			0h..0$#\\
11$dJ5)Wm]K1g ,11':gn _G3'K!!+}=+K"";>+'88:%0?0?(/[,7dD!QX QK'""$3%%c*C1C1CC1Hi0-ll=)=  /1F ::Lfg?'--g6'	.K && -
##At,,## 
4
a{  ## 
s0    8F G)GGG!G6 6HHzraw_ops.FusedBatchNormGradV2c
           
         |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | |g|	t
        j                  t
        j                  t
        j                  g      \  }
}|\  } }t        j                  ||g|	t
        j                  g      \  }}|\  }}t        j                  |t
        j                        }| ||||g}d|
d|d|d|d|f
}t        j                  d	d
|||	|      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr  r  r^   ra   Tr  r%   r.  s   FusedBatchNormGradV2r   rT   r*  )r;   r=   rn   r>   rV   rW   rX   rY   rZ   r.   r   r   rA   rG   r/  r+   )r!  rc  r
  r  r  r  ra   r  r    r!   r[   r   _attr_U	_inputs_UrP   rO   rJ   s                    rQ   r0  r0    sj   _G3'K!!+}=+K"";>+66
Agll\c\l\lnun}n}  NA  B'9/:q667Y[^ahapap`st'9'0$?O

 
 
8%aI,#w	7M}k+&4a#)s?'""$fg?'--g6'	.r\   FusedBatchNormGradV3)r  r  r  r  reserve_space_5TV_FusedBatchNormGradV3_TTV_FusedBatchNormGradV3_Ur  c
                 &   t         j                   xs t        j                         }
|
j                  }|j                  r;	 t	        j
                  |
d|	| |||||d|d|d|      }t        j                  |      }|S |d}t        j                   |d      }|d}t        j"                  |d      }|d	}t        j$                  |d      }t'        j(                  d| |||||||||	
      \  }}}}|dd }t        j*                         r{d|j-                  d      d|j-                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t        j4                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||	       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
      S # t        j                  $ r Y w xY w)a	  Gradient for batch normalization.

  Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW".
  The size of 1D Tensors matches the dimension C of the 4D Tensors.

  Args:
    y_backprop: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      A 4D Tensor for the gradient with respect to y.
    x: A `Tensor`. Must have the same type as `y_backprop`.
      A 4D Tensor for input data.
    scale: A `Tensor` of type `float32`.
      A 1D Tensor for scaling factor, to scale the normalized x.
    reserve_space_1: A `Tensor`. Must be one of the following types: `float32`.
      When is_training is True, a 1D Tensor for the computed batch
      mean to be reused in gradient computation. When is_training is
      False, a 1D Tensor for the population mean to be reused in both
      1st and 2nd order gradient computation.
    reserve_space_2: A `Tensor`. Must have the same type as `reserve_space_1`.
      When is_training is True, a 1D Tensor for the computed batch
      variance (inverted variance in the cuDNN case) to be reused in
      gradient computation. When is_training is False, a 1D Tensor
      for the population variance to be reused in both 1st and 2nd
      order gradient computation.
    reserve_space_3: A `Tensor`. Must have the same type as `reserve_space_1`.
      When is_training is True, a 1D Tensor for some intermediate results to be reused
      in gradient computation. When is_training is False, a dummy empty Tensor will be
      created.
    epsilon: An optional `float`. Defaults to `0.0001`.
      A small float number added to the variance of x.
    data_format: An optional `string` from: `"NHWC", "NCHW", "NDHWC", "NCDHW"`. Defaults to `"NHWC"`.
      The data format for y_backprop, x, x_backprop.
      Either "NHWC" (default) or "NCHW".
    is_training: An optional `bool`. Defaults to `True`.
      A bool value to indicate the operation is for training (default)
      or inference.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (x_backprop, scale_backprop, offset_backprop, reserve_space_4, reserve_space_5).

    x_backprop: A `Tensor`. Has the same type as `y_backprop`.
    scale_backprop: A `Tensor`. Has the same type as `reserve_space_1`.
    offset_backprop: A `Tensor`. Has the same type as `reserve_space_1`.
    reserve_space_4: A `Tensor`. Has the same type as `reserve_space_1`.
    reserve_space_5: A `Tensor`. Has the same type as `reserve_space_1`.
  r5  r  ra   r  Nr#  r  r^   T)
r!  rc  r
  r  r  r  r  ra   r  r    r%   r.  )r&   r   r'   r(   r   r)   _FusedBatchNormGradV3Outputr+   r,   r-   r.   r/   r0   'fused_batch_norm_grad_v3_eager_fallbackr4   r;   r=   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   )r!  rc  r
  r  r  r  r  ra   r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                      rQ   fused_batch_norm_grad_v3r<    s/   ^ 
			0h..0$#\\
11$dJ5/9g{M;@g ,11':gn _G3'K!!+}=+K"";>+'88:%0?0?0?(/[,7dD!QX QK'""$3%%c*C1C1CC1Hi0-ll=)=  /1F ::Lfg?'--g6'	.M && -
##At,,## 
4
a
7!$8 8 ## 
s0    9F G+GGG#G9 9HHzraw_ops.FusedBatchNormGradV3c           
         |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | |g|
t
        j                  t
        j                  t
        j                  g      \  }}|\  } }t        j                  |||g|
t
        j                  g      \  }}|\  }}}t        j                  |t
        j                        }| |||||g}d|d|d|d|d|f
}t        j                  d	d
|||
|	      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr  r  r^   ra   Tr  r%   r.  s   FusedBatchNormGradV3r   rT   r5  )r;   r=   rn   r>   rV   rW   rX   rY   rZ   r.   r   r   rA   rG   r:  r+   )r!  rc  r
  r  r  r  r  ra   r  r    r!   r[   r   r3  r4  rP   rO   rJ   s                     rQ   r;  r;  g  s   _G3'K!!+}=+K"";>+66
Agll\c\l\lnun}n}  NA  B'9/:q66Zi7jlory  sB  sB  rE  F'98A5?O_

 
 
8%a/Z,#w	7M}k+&4a#)s?'""$fg?'--g6'	.r\   FusedBatchNormV2TV_FusedBatchNormV2_TTV_FusedBatchNormV2_Uc
                 ~   t         j                   xs t        j                         }
|
j                  }|j                  r<	 t	        j
                  |
d|	| ||||d|d|d|d|      }t        j                  |      }|S |d}t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d}t        j$                  |d      }t'        j(                  d| |||||||||	      \  }}}}|dd }t        j*                         rd|j-                  d      d|j-                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f}|j2                  }t        j4                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||	       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
      S # t        j                  $ r Y w xY w)a  Batch normalization.

  Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW".
  The size of 1D Tensors matches the dimension C of the 4D Tensors.

  Args:
    x: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      A 4D Tensor for input data.
    scale: A `Tensor`. Must be one of the following types: `float32`.
      A 1D Tensor for scaling factor, to scale the normalized x.
    offset: A `Tensor`. Must have the same type as `scale`.
      A 1D Tensor for offset, to shift to the normalized x.
    mean: A `Tensor`. Must have the same type as `scale`.
      A 1D Tensor for population mean. Used for inference only;
      must be empty for training.
    variance: A `Tensor`. Must have the same type as `scale`.
      A 1D Tensor for population variance. Used for inference only;
      must be empty for training.
    epsilon: An optional `float`. Defaults to `0.0001`.
      A small float number added to the variance of x.
    exponential_avg_factor: An optional `float`. Defaults to `1`.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      The data format for x and y. Either "NHWC" (default) or "NCHW".
    is_training: An optional `bool`. Defaults to `True`.
      A bool value to indicate the operation is for training (default)
      or inference.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (y, batch_mean, batch_variance, reserve_space_1, reserve_space_2).

    y: A `Tensor`. Has the same type as `x`.
    batch_mean: A `Tensor`. Has the same type as `scale`.
    batch_variance: A `Tensor`. Has the same type as `scale`.
    reserve_space_1: A `Tensor`. Has the same type as `scale`.
    reserve_space_2: A `Tensor`. Has the same type as `scale`.
  r>  r  r  ra   r  Nr  r  rs   r^   Tr  r%   r.  )r&   r   r'   r(   r   r)   _FusedBatchNormV2Outputr+   r,   r-   r.   r/   r0   "fused_batch_norm_v2_eager_fallbackr4   r;   r=   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   r  s                      rQ   fused_batch_norm_v2rD    sc   L 
			0h..0$#\\
11 $5&$746L{M;@g (--g6gn _G3'##../EG_`K!!+}=+K"";>+'88auV$%-w3I(3!%'!QX QK'""$3%%c*C1C1CC1Hi02Jll34mll=)=  /	1F
 ::LL&';#))'2'	.U && -
##At,,## 
/
UFD(G!7!{	 
 ## 
0    :G HG22H
HH% %H<;H<zraw_ops.FusedBatchNormV2c                    |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|
t
        j                  t
        j                  t
        j                  g      \  }\  } t        j                  ||||g|
t
        j                  g      \  }}|\  }}}}| ||||g}d	|d
|d|d|d|d|f}t        j                  dd|||
|	      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr  r  rs   r  r^   ra   Tr  r%   r.  s   FusedBatchNormV2r   rT   r>  )r;   r=   rn   r>   rV   rW   rX   rY   rZ   r   rA   rG   rB  r+   rc  r
  r  r  r  r  r  ra   r  r    r!   r[   r3  r4  rP   rO   rJ   s                    rQ   rC  rC    ss   _G3'##../EG_`K!!+}=+K"";>+111#sW\\7K[K[]d]l]l<op-'4A66vtX7VX[^e^m^m]pq'9$-!5&$UFD(3,#w	72M}k+& 0!L#)s?'""$L&';#))'2'	.r\   FusedBatchNormV3)r  r  r  r  r  r  TV_FusedBatchNormV3_TTV_FusedBatchNormV3_Uc
                 ~   t         j                   xs t        j                         }
|
j                  }|j                  r<	 t	        j
                  |
d|	| ||||d|d|d|d|      }t        j                  |      }|S |d}t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d}t        j$                  |d      }t'        j(                  d| |||||||||	      \  }}}}|dd }t        j*                         rd|j-                  d      d|j-                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f}|j2                  }t        j4                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||	       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
      S # t        j                  $ r Y w xY w)av  Batch normalization.

  Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW".
  The size of 1D Tensors matches the dimension C of the 4D Tensors.

  Args:
    x: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      A 4D Tensor for input data.
    scale: A `Tensor`. Must be one of the following types: `bfloat16`, `float32`.
      A 1D Tensor for scaling factor, to scale the normalized x.
    offset: A `Tensor`. Must have the same type as `scale`.
      A 1D Tensor for offset, to shift to the normalized x.
    mean: A `Tensor`. Must have the same type as `scale`.
      A 1D Tensor for population mean. Used for inference only;
      must be empty for training.
    variance: A `Tensor`. Must have the same type as `scale`.
      A 1D Tensor for population variance. Used for inference only;
      must be empty for training.
    epsilon: An optional `float`. Defaults to `0.0001`.
      A small float number added to the variance of x.
    exponential_avg_factor: An optional `float`. Defaults to `1`.
    data_format: An optional `string` from: `"NHWC", "NCHW", "NDHWC", "NCDHW"`. Defaults to `"NHWC"`.
      The data format for x and y. Either "NHWC" (default) or "NCHW".
    is_training: An optional `bool`. Defaults to `True`.
      A bool value to indicate the operation is for training (default)
      or inference.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (y, batch_mean, batch_variance, reserve_space_1, reserve_space_2, reserve_space_3).

    y: A `Tensor`. Has the same type as `x`.
    batch_mean: A `Tensor`. Has the same type as `scale`.
    batch_variance: A `Tensor`. Has the same type as `scale`.
    reserve_space_1: A `Tensor`. Has the same type as `scale`.
    reserve_space_2: A `Tensor`. Has the same type as `scale`.
    reserve_space_3: A `Tensor`. Has the same type as `scale`.
  rH  r  r  ra   r  Nr  r  rs   r^   Tr  r%   r.  )r&   r   r'   r(   r   r)   _FusedBatchNormV3Outputr+   r,   r-   r.   r/   r0   "fused_batch_norm_v3_eager_fallbackr4   r;   r=   rn   r>   r?   r@   rA   rE   rC   rD   rF   rG   r  s                      rQ   fused_batch_norm_v3rN    sc   N 
			0h..0$#\\
11 $5&$746L{M;@g (--g6gn _G3'##../EG_`K!!+}=+K"";>+'88auV$%-w3I(3!%'!QX QK'""$3%%c*C1C1CC1Hi02Jll34mll=)=  /	1F
 ::LL&';#))'2'	.U && -
##At,,## 
/
UFD(G!7!{	 
 ## 
rE  zraw_ops.FusedBatchNormV3c                    |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|
t
        j                  t
        j                  t
        j                  g      \  }\  } t        j                  ||||g|
t
        j                  t
        j                  g      \  }}|\  }}}}| ||||g}d	|d
|d|d|d|d|f}t        j                  dd|||
|	      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr  r  rs   r  r^   ra   Tr  r%   r.  s   FusedBatchNormV3   rT   rH  )r;   r=   rn   r>   rV   rW   rX   rY   rZ   r   rA   rG   rL  r+   rG  s                    rQ   rM  rM  l  s   _G3'##../EG_`K!!+}=+K"";>+111#sW\\7K[K[]d]l]l<op-'4A66vtX7VX[^e^n^npwpp  ^C  D'9$-!5&$UFD(3,#w	72M}k+& 0!L#)s?'""$L&';#))'2'	.r\   TV_FusedPadConv2D_Tpaddingsmodec                    t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| ||d|d|d|      }	|	S t        j                  |d      }t        |t         t"        f      st%        d|z        |D cg c]  }t        j&                  |d       }}t        j                  |d      }t)        j*                  d| ||||||      \  }}}}|dd }	t        j,                         rjd	|j/                  d	      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t        j4                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w )
a  Performs a padding as a preprocess during a convolution.

  Similar to FusedResizeAndPadConv2d, this op allows for an optimized
  implementation where the spatial padding transformation stage is fused with the
  im2col lookup, but in this case without the bilinear filtering required for
  resizing. Fusing the padding prevents the need to write out the intermediate
  results as whole tensors, reducing memory pressure, and we can get some latency
  gains by merging the transformation calculations.
  The data_format attribute for Conv2D isn't supported by this op, and 'NHWC'
  order is used instead.
  Internally this op uses a single per-graph scratch buffer, which means that it
  will block if multiple versions are being run in parallel. This is because this
  operator is primarily an optimization to minimize memory usage.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      4-D with shape `[batch, in_height, in_width, in_channels]`.
    paddings: A `Tensor` of type `int32`.
      A two-column matrix specifying the padding sizes. The number of
      rows must be the same as the rank of `input`.
    filter: A `Tensor`. Must have the same type as `input`. 4-D with shape
      `[filter_height, filter_width, in_channels, out_channels]`.
    mode: A `string` from: `"REFLECT", "SYMMETRIC"`.
    strides: A list of `ints`.
      1-D of length 4.  The stride of the sliding window for each dimension
      of `input`. Must be in the same order as the dimension specified with format.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  FusedPadConv2DrS  rf   r`   N)rS  rf   r`   r    r!   FExpected list for 'strides' argument to 'fused_pad_conv2d' Op, not %r.)r   rR  r   rS  rf   r`   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   fused_pad_conv2d_eager_fallbackr4   r;   rn   rk   rl   rm   r5   r<   r?   r@   rA   rE   rC   rF   rG   )r   rR  r   rS  rf   r`   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                    rQ   fused_pad_conv2drX    s   D 
			0h..0$#\\11eXvvt7Iw0g n 
		4	($	GdE]	+
	)+2	34 4 9@@"Xr9-@'@gy1''88#Wg#%!QX QK'""$3%%c*FCLL4Hi0)ll9%'F ::L,9('	.? && -
##At,,## 
,
6g$0 0 ## 
 As6    !F   G8 GF..GGG G54G5zraw_ops.FusedPadConv2Dc                    t        j                  |d      }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  |d      }t        j                  | |g|t        j                  t        j                  t        j                  t        j                  g      \  }	}
|
\  } }t        j                  |t        j                        }| ||g}d|	d|d|d|f}t        j                   dd||||      }t        j"                         rt        j$                  d	|||       |\  }|S c c}w )
NrS  rV  rf   r`   r%   s   FusedPadConv2Drs   rT   rU  )r;   rn   rk   rl   rm   r5   r<   rV   rW   rX   rY   rZ   ru   r.   r   r   r   rA   rG   )r   rR  r   rS  rf   r`   r    r!   ro   r[   r   rP   rO   rJ   s                 rQ   rW  rW    sZ   			4	($	GdE]	+
	)+2	34 4 9@@"Xr9-@'@gy1'66vgll\c\l\lnun}n}  @G  @O  @O  NR  S'9/5&##Hgmm<(6*,&$	7I	&.,#)s?'""$,9('	. As   ETV_FusedResizeAndPadConv2D_Tsizeresize_align_cornersc	                 ^   t         j                   xs t        j                         }	|	j                  }
|
j                  r&	 t	        j
                  |	d|| |||d|d|d|d|      }|S t        j                  |d      }t        |t         t"        f      st%        d|z        |D cg c]  }t        j&                  |d       }}t        j                  |d      }|d	}t        j(                  |d      }t+        j,                  d| ||||||||

      \  }}}}|dd }t        j.                         r{d|j1                  d      d|j3                  d      d|j5                  d      d|j5                  d      d|j5                  d      f
}|j6                  }t        j8                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	
      S # t        j                  $ r Y w xY wc c}w )a  Performs a resize and padding as a preprocess during a convolution.

  It's often possible to do spatial transformations more efficiently as part of
  the packing stage of a convolution, so this op allows for an optimized
  implementation where these stages are fused together. This prevents the need to
  write out the intermediate results as whole tensors, reducing memory pressure,
  and we can get some latency gains by merging the transformation calculations.
  The data_format attribute for Conv2D isn't supported by this op, and defaults to
  'NHWC' order.
  Internally this op uses a single per-graph scratch buffer, which means that it
  will block if multiple versions are being run in parallel. This is because this
  operator is primarily an optimization to minimize memory usage.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`.
      4-D with shape `[batch, in_height, in_width, in_channels]`.
    size: A `Tensor` of type `int32`.
      A 1-D int32 Tensor of 2 elements: `new_height, new_width`.  The
      new size for the images.
    paddings: A `Tensor` of type `int32`.
      A two-column matrix specifying the padding sizes. The number of
      rows must be the same as the rank of `input`.
    filter: A `Tensor`. Must have the same type as `input`. 4-D with shape
      `[filter_height, filter_width, in_channels, out_channels]`.
    mode: A `string` from: `"REFLECT", "SYMMETRIC"`.
    strides: A list of `ints`.
      1-D of length 4.  The stride of the sliding window for each dimension
      of `input`. Must be in the same order as the dimension specified with format.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    resize_align_corners: An optional `bool`. Defaults to `False`.
      If true, the centers of the 4 corner pixels of the input and output tensors are
      aligned, preserving the values at the corner pixels. Defaults to false.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  FusedResizeAndPadConv2Dr\  rS  rf   r`   N)r\  rS  rf   r`   r    r!   QExpected list for 'strides' argument to 'fused_resize_and_pad_conv2d' Op, not %r.F)	r   r[  rR  r   rS  rf   r`   r\  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   *fused_resize_and_pad_conv2d_eager_fallbackr4   r;   rn   rk   rl   rm   r5   r<   r>   r?   r@   rA   rE   rD   rC   rF   rG   )r   r[  rR  r   rS  rf   r`   r\  r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                      rQ   fused_resize_and_pad_conv2dra    sR   N 
			0h..0$#\\	11'udHf 4fdIG%g n 
		4	($	GdE]	+
	46=	>? ? 9@@"Xr9-@'@gy1'! !++,@BXY'88!TH*0tW+28L(,.!QX QK'""$3%%c*,B  !78&ll6"Is||I/Fi02F ::L!<B('	.M && -
##At,,## 
7
x3$74A A ## 
 As6    $F0 #H*0G7GG76G7;H H'&H'zraw_ops.FusedResizeAndPadConv2Dc
           
         t        j                  |d      }t        |t        t        f      st        d|z        |D 
cg c]  }
t        j                  |
d       }}
t        j                  |d      }|d}t        j                  |d      }t        j                  | |g|	t        j                  t        j                  t        j                  g      \  }}|\  } }t        j                  |t        j                        }t        j                  |t        j                        }| |||g}d|d|d|d|d|f
}t        j                   dd	|||	|
      }t        j"                         rt        j$                  d|||       |\  }|S c c}
w )NrS  r_  rf   r`   Fr\  r%   s   FusedResizeAndPadConv2Drs   rT   r^  )r;   rn   rk   rl   rm   r5   r<   r>   rV   rW   rX   rZ   ru   r.   r   r   r   rA   rG   )r   r[  rR  r   rS  rf   r`   r\  r    r!   ro   r[   r   rP   rO   rJ   s                   rQ   r`  r`  M  s   			4	($	GdE]	+
	46=	>? ? 9@@"Xr9-@'@gy1'! !++,@BXY66vgll\c\k\kmtm|m|M  A'9/5&			gmm	4$##Hgmm<(x0,02F$	7Iw8&7$0C"&(' ""$!<B('	.' As   FTV_InTopK_Tpredictionstargetsc           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S t        j                  |d      }t        j                   d| |||      \  }}}	}
|
dd }t        j"                         rHd|	j%                  d      d|	j'                  d      f}|	j(                  }t        j*                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a|  Says whether the targets are in the top `K` predictions.

  This outputs a `batch_size` bool array, an entry `out[i]` is `true` if the
  prediction for the target class is among the top `k` predictions among
  all predictions for example `i`. Note that the behavior of `InTopK` differs
  from the `TopK` op in its handling of ties; if multiple classes have the
  same prediction value and straddle the top-`k` boundary, all of those
  classes are considered to be in the top `k`.

  More formally, let

    \\(predictions_i\\) be the predictions for all classes for example `i`,
    \\(targets_i\\) be the target class for example `i`,
    \\(out_i\\) be the output for example `i`,

  $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$

  Args:
    predictions: A `Tensor` of type `float32`.
      A `batch_size` x `classes` tensor.
    targets: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      A `batch_size` vector of class ids.
    k: An `int`. Number of top elements to look at for computing precision.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `bool`.
  InTopKr   N)r   r    r!   rd  re  r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   in_top_k_eager_fallbackr4   r;   r<   r?   r@   rA   rB   rE   rF   rG   rd  re  r   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                rQ   in_top_krk  k  sg   : 
			0h..0$#\\11hk7C<gn 3!'88k7adL!QXQK'""$3$$S)30B0B30GHF::L,1('	.) && -
##At,,## 
$
w!$D: :## 
s0    C9 9E D''E ?E E E+*E+zraw_ops.InTopKc                    t        j                  |d      }t        j                  |g|t        j                  t        j
                  gt        j                        \  }\  }t        j                  | t        j                        } | |g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr   r%   s   InTopKrs   rT   rg  )r;   r<   rV   rW   r   r   r.   r   rZ   r   rA   rG   )	rd  re  r   r    r!   r[   rP   rO   rJ   s	            rQ   ri  ri    s    3! 77	3X_XeXeHhjqjwjwx':G&&{GOOD+w',C!&Y,f!$41'""$,1('	.r\   TV_InTopKV2_Tc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||      }|S t        j                  d| |||      \  }}}	}
|
dd }t        j                          r7d|	j#                  d      f}|	j$                  }t        j&                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Says whether the targets are in the top `K` predictions.

  This outputs a `batch_size` bool array, an entry `out[i]` is `true` if the
  prediction for the target class is among the top `k` predictions among
  all predictions for example `i`. Note that the behavior of `InTopK` differs
  from the `TopK` op in its handling of ties; if multiple classes have the
  same prediction value and straddle the top-`k` boundary, all of those
  classes are considered to be in the top `k`.

  More formally, let

    \\(predictions_i\\) be the predictions for all classes for example `i`,
    \\(targets_i\\) be the target class for example `i`,
    \\(out_i\\) be the output for example `i`,

  $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$

  Args:
    predictions: A `Tensor` of type `float32`.
      A `batch_size` x `classes` tensor.
    targets: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      A `batch_size` vector of class ids.
    k: A `Tensor`. Must have the same type as `targets`.
      Number of top elements to look at for computing precision.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `bool`.
  InTopKV2Nr   rh  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   in_top_kv2_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   rj  s                rQ   
in_top_kv2rq    sD   < 
			0h..0$#\\11j$Wa9gn (88WN!QXQK'""$3%%c*+F::LL&'3('	.' && -
##At,,## 
&
w$8 8## 
s0    C D$C??DDD, ,EEzraw_ops.InTopKV2c                    t        j                  ||g|t        j                  t        j                  gt        j                        \  }}|\  }}t        j                  | t        j                        } | ||g}d|f}t        j                  dd||||      }	t        j                         rt        j                  d|||	       |	\  }	|	S )Nr%   s   InTopKV2rs   rT   ro  )r;   rV   rW   r   r   r.   r   rZ   r   rA   rG   )
rd  re  r   r    r!   r[   r   rP   rO   rJ   s
             rQ   rp  rp    s    66|S7==ZaZgZgJjlslylyz'9,7A&&{GOOD+w*,>&[!L#)s?'""$L&'3('	.r\   IsotonicRegressionr  segmentsTV_IsotonicRegression_T"TV_IsotonicRegression_output_dtypeoutput_dtypec                 F   t         j                   xs t        j                         }|j                  }|j                  r2	 t	        j
                  |d|| d|      }t        j                  |      }|S |t        j                   }t#        j$                  |d      }t'        j(                  d| ||      \  }}}}	|	dd }t#        j*                         rHd|j-                  d      d|j-                  d      f}
|j.                  }t#        j0                  d||
|       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y .w xY w)a  Solves a batch of isotonic regression problems.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      A (batch_size, dim)-tensor holding a batch of inputs.
    output_dtype: An optional `tf.DType` from: `tf.half, tf.bfloat16, tf.float32, tf.float64`. Defaults to `tf.float32`.
      Dtype of output.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, segments).

    output: A `Tensor` of type `output_dtype`.
    segments: A `Tensor` of type `int32`.
  rs  rw  N)rw  r    r!   )r   rw  r    r%   )r&   r   r'   r(   r   r)   _IsotonicRegressionOutputr+   r,   r-   r.   r/   r0   "isotonic_regression_eager_fallbackr4   rW   rZ   r;   	make_typer?   r@   rA   rE   rF   rG   )r   rw  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s               rQ   isotonic_regressionr|    s     
			0h..0$#\\11"D%Og)//8gn ??L##L.A,'88E#')!QX QK'""$3%%c*N  02F::LlFG=%++G4'	.1 && -
##At,,## 
/
l4A A## 
s0    0D/ /E6EE65E6:F	 	F F zraw_ops.IsotonicRegressionc                    |t         j                  }t        j                  |d      }t        j                  | g|t         j                  t         j
                  t         j                  t         j                  t         j                  t         j                  t         j                  t         j                  t         j                  t         j                  t         j                  t         j                  g      \  }\  } | g}d|d|f}t        j                   dd||||      }t        j"                         rt        j$                  d|||       t&        j)                  |      }|S )Nrw  r%   s   IsotonicRegressionrS   rT   rs  )rW   rZ   r;   r{  rV   ru   r   r   r   r   r   rY   r   rX   r   r   r   rA   rG   ry  r+   )r   rw  r    r!   r[   rP   rO   rJ   s           rQ   rz  rz  A  s   ??L##L.A,55ugsW__V]VeVegngtgtv}  wD  wD  FM  FS  FS  U\  Ua  Ua  cj  cp  cp  ry  rB  rB  DK  DR  DR  T[  T`  T`  bi  bp  bp  ry  r@  r@  EC  D'8E,.,7&2Al#)s?'""$lFG=%++G4'	.r\   TV_L2Loss_Tz
nn.l2_lossc           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)ai  L2 Loss.

  Computes half the L2 norm of a tensor without the `sqrt`:

      output = sum(t ** 2) / 2

  Args:
    t: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      Typically 2-D, but may have any dimensions.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `t`.
  L2LossNr   r"   )r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   _dispatcher_for_l2_lossr2   l2_loss_eager_fallbackr4   r5   r6   r7   r   l2_lossr8   r9   r:   r?   r@   r;   rA   rE   rF   rG   )r   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s              rQ   r  r  S  s   $ 
			0h..0$#\\11ha!gn, &	
D
DGn$n	
)::AD"Aq#x QK'""$3%%c*+F::L,1('	.W && -
##At,,## 
'd*dg		&#
$D" "## 
z" ""R-g 
	..<<	<  Z	  
  
2tad+
G i,,:::n	
r  zraw_ops.L2Lossc                 \   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  g      \  }\  } | g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   L2Lossrs   rT   r  r  )r   r    r!   r[   rP   rO   rJ   s          rQ   r  r    s    111#sW\\7K[K[]d]l]lnun}n}  =A  B-'4A,>&Y,f!$41'""$,1('	.r\   TV_LRN_Tznn.local_response_normalizationznn.lrndepth_radiusalphac                    t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| d|d|d|d|      }|S t        | |||||fd      }|t        ur|S |d
}t/        j0                  |d      }|d}t/        j2                  |d      }|d}t/        j2                  |d      }|d}t/        j2                  |d      }	 t5        j6                  d| |||||	      \  }
}
}}|dd }t/        j8                         r{d|j;                  d      d|j=                  d      d|j=                  d      d|j=                  d      d|j?                  d      f
}|j@                  }t/        jB                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | |||||fd      }|t        ur|S t        | ||||||      S # t        j                  $ r Y t        t         f$ rL t#        j$                  t&        dt)        | |||||	            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rL t#        j$                  t&        dt)        | |||||	            }|t"        j*                  j,                  ur|cY S  w xY w)a  Local Response Normalization.

  The 4-D `input` tensor is treated as a 3-D array of 1-D vectors (along the last
  dimension), and each vector is normalized independently.  Within a given vector,
  each component is divided by the weighted, squared sum of inputs within
  `depth_radius`.  In detail,

      sqr_sum[a, b, c, d] =
          sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)
      output = input / (bias + alpha * sqr_sum) ** beta

  For details, see [Krizhevsky et al., ImageNet classification with deep
  convolutional neural networks (NIPS 2012)](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks).

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      4-D.
    depth_radius: An optional `int`. Defaults to `5`.
      0-D.  Half-width of the 1-D normalization window.
    bias: An optional `float`. Defaults to `1`.
      An offset (usually positive to avoid dividing by 0).
    alpha: An optional `float`. Defaults to `1`.
      A scale factor, usually positive.
    beta: An optional `float`. Defaults to `0.5`. An exponent.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  LRNr  r   r  r   Nr  r   r  r   r    r!   r"   )r   r  r   r  r   r    r   rs         ?r%   )"r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   _dispatcher_for_lrnr2   lrn_eager_fallbackr4   r5   r6   r7   r   lrnr8   r9   r:   r;   r<   r=   r?   r@   rA   rB   rC   rE   rF   rG   )r   r  r   r  r   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                  rQ   r  r    s   B 
			0h..0$#\\11eT5.,&g n0 "	dE47?Gn$nL""<@,	\D			T6	*$
]E


eW
-%	\D			T6	*$
)::UDt%Aq#x QK'""$c//?ll6"GS\\'-BFll6"C););C)@BF ::L|VW.('	.{ && -
##At,,## 
#,eT4
94Ag		&
lU  ## 
z" ""TLt %Dt=g 
	..<<	<< Z	  
  
r4e,T#$T;
G i,,:::n	
sP    !F" '!J "G)5GG)(G)-H 	H J1AJ	JAK)'K)zraw_ops.LRNc           
      <   |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j
                  t        j                  t        j                  gt        j                        \  }\  } | g}d|d|d|d|d|f
}	t        j                  d	d||	||
      }
t        j                         rt        j                  d||	|
       |
\  }
|
S )Nr   r  rs   r   r  r  r   r%   s   LRNrT   r  r;   r<   r=   rV   rW   rX   rY   rZ   r   rA   rG   )r   r  r   r  r   r    r!   r[   rP   rO   rJ   s              rQ   r  r    s1   L""<@,	\D			T6	*$
]E


eW
-%	\D			T6	*$55ugsW\\SZScSceletetDw  zA  zI  zI  J'8E,L&$$W&VQ|6!$41'""$|VW.('	.r\   TV_LRNGrad_Tinput_gradsinput_imageoutput_imagec                    t         j                   xs t        j                         }|j                  }	|	j                  r%	 t	        j
                  |d|| ||d|d|d|d|      }
|
S |d}t        j                  |d      }|d	}t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  d| |||||||	      \  }}}}|dd }
t        j$                         r{d|j'                  d      d|j)                  d      d|j)                  d      d|j)                  d      d|j+                  d      f
}|j,                  }t        j.                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y w xY w)a  Gradients for Local Response Normalization.

  Args:
    input_grads: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      4-D with shape `[batch, height, width, channels]`.
    input_image: A `Tensor`. Must have the same type as `input_grads`.
      4-D with shape `[batch, height, width, channels]`.
    output_image: A `Tensor`. Must have the same type as `input_grads`.
      4-D with shape `[batch, height, width, channels]`.
    depth_radius: An optional `int`. Defaults to `5`. A depth radius.
    bias: An optional `float`. Defaults to `1`.
      An offset (usually > 0 to avoid dividing by 0).
    alpha: An optional `float`. Defaults to `1`.
      A scale factor, usually positive.
    beta: An optional `float`. Defaults to `0.5`. An exponent.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input_grads`.
  LRNGradr  r   r  r   Nr  r   rs   r  )r  r  r  r  r   r  r   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   lrn_grad_eager_fallbackr4   r;   r<   r=   r?   r@   rA   rB   rC   rE   rF   rG   )r  r  r  r  r   r  r   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                    rQ   lrn_gradr  4  s    * 
			0h..0$#\\	11i{KfdGUFg n L""<@,	\D			T6	*$
]E


eW
-%	\D			T6	*$'88{ ,<E4A!QX QK'""$c//?ll6"GS\\'-BFll6"C););C)@BF ::L<2('	.I && -
##At,,## 
$
{L|5t$DB B ## 
s0    #F	 	GF77GGG( (G?>G?zraw_ops.LRNGradc	           
      L   |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | ||g|t        j
                  t        j                  t        j                  gt        j                        \  }	}
|
\  } }}| ||g}d|d|d|d|d|	f
}t        j                  d	d||||
      }t        j                         rt        j                  d|||       |\  }|S )Nr   r  rs   r   r  r  r   r%   s   LRNGradrT   r  r  )r  r  r  r  r   r  r   r    r!   r[   r   rP   rO   rJ   s                 rQ   r  r  {  sb   L""<@,	\D			T6	*$
]E


eW
-%	\D			T6	*$66[R^7_adgngsgsu|  vF  vF  HO  HW  HW  gZ  \c  \k  \k  l'9-6*;\{L9,L&$$W&Z<v!$41'""$<2('	.r\   TV_LeakyRelu_Tc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|      }|S |d}t        j                  |d      }t        j                   d| ||      \  }}}}	|	dd }t        j"                         rHd|j%                  d      d|j'                  d      f}
|j(                  }t        j*                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)aP  Computes rectified linear: `max(features, features * alpha)`.

  Args:
    features: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
    alpha: An optional `float`. Defaults to `0.2`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `features`.
  	LeakyRelur  Nr  r    r!   皙?)r  r  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   leaky_relu_eager_fallbackr4   r;   r=   r?   r@   rA   rC   rE   rF   rG   )r  r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s               rQ   
leaky_relur    si    
			0h..0$#\\11k47E;gn ]E


eW
-%'88he$@!QXQK'""$s||G,c33E3Ec3JKF::L\674('	.- && -
##At,,## 
&
%d6 6## 
r   zraw_ops.LeakyReluc                    |d}t        j                  |d      }t        j                  | g|t        j                  t        j
                  t        j                  t        j                  gt        j                        \  }\  } | g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr  r  r%   s	   LeakyRelurs   rT   r  r;   r=   rV   rW   rX   rY   rZ   ru   r   rA   rG   )r  r  r    r!   r[   rP   rO   rJ   s           rQ   r  r    s    
]E


eW
-%!88(S7<<Y`YiYikrkzkz  }D  }L  }L  KO  QX  Q`  Q`  a';H,UC)&\1\#)s?'""$\674('	.r\   TV_LeakyReluGrad_Tc           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |d}t        j                  |d      }t        j                   d| |||      \  }}}	}
|
dd }t        j"                         rHd|	j%                  d      d|	j'                  d      f}|	j(                  }t        j*                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)ap  Computes rectified linear gradients for a LeakyRelu operation.

  Args:
    gradients: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      The backpropagated gradients to the corresponding LeakyRelu operation.
    features: A `Tensor`. Must have the same type as `gradients`.
      The features passed as input to the corresponding LeakyRelu operation,
      OR the outputs of that operation (both work equivalently).
    alpha: An optional `float`. Defaults to `0.2`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `gradients`.
  LeakyReluGradr  Nr  r  )r  r  r  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   leaky_relu_grad_eager_fallbackr4   r;   r=   r?   r@   rA   rC   rE   rF   rG   )r  r  r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                rQ   leaky_relu_gradr    st    
			0h..0$#\\11otY'5Jgn ]E


eW
-%'889xu"$!QX QK'""$s||G,c33E3Ec3JKF::Lvw8('	./ && -
##At,,## 
+
XU4A A## 
r   zraw_ops.LeakyReluGradc                    |d}t        j                  |d      }t        j                  | |g|t        j                  t        j
                  t        j                  t        j                  gt        j                        \  }}|\  } }| |g}d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d|||	       |	\  }	|	S )Nr  r  r%   s   LeakyReluGradrs   rT   r  r  )
r  r  r  r    r!   r[   r   rP   rO   rJ   s
             rQ   r  r  	  s    
]E


eW
-%66	87LcT[T`T`bibrbrt{  uD  uD  FM  FU  FU  TX  Za  Zi  Zi  j'9#9hX&,UC)&-q#)s?'""$vw8('	.r\   TV_LogSoftmax_Tlogitsc                 ~   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r7d|j#                  d      f}	|j$                  }
t        j&                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)a  Computes log softmax activations.

  For each batch `i` and class `j` we have

      logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i])))

  Args:
    logits: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      2-D with shape `[batch_size, num_classes]`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `logits`.
  
LogSoftmaxNr   r  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   log_softmax_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s              rQ   log_softmaxr    s7    
			0h..0$#\\11lD&*gn (88V$0!QXQK'""$3%%c*+F::LlFG5('	.' && -
##At,,## 
'
t' '## 
0    C D C;;DDD& &D<;D<zraw_ops.LogSoftmaxc                 \   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  g      \  }\  } | g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s
   LogSoftmaxrs   rT   r  r  r  r    r!   r[   rP   rO   rJ   s          rQ   r  r  J  s    66xw||U\UeUegngvgvx  yH  yH  GK  L'9F,>&]Al#)s?'""$lFG5('	.r\   TV_MaxPool_Tc                    t         j                   xs t        j                         }|j                  }|j                  r%	 t	        j
                  |d|| d|d|d|d|d|      }	|	S t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d
|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|g }t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}|d}t#        j&                  |d      }t)        j*                  d| ||||||      \  }}}}|dd }	t#        j,                         rd|j/                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y Jw xY wc c}w c c}w c c}w )a  Performs max pooling on the input.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, `qint8`.
      4-D input to pool over.
    ksize: A list of `ints` that has length `>= 4`.
      The size of the window for each dimension of the input tensor.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
    data_format: An optional `string` from: `"NHWC", "NCHW", "NCHW_VECT_C"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  MaxPoolre   rf   r`   r   ra   Nre   rf   r`   r   ra   r    r!   <Expected list for 'ksize' argument to 'max_pool' Op, not %r.>Expected list for 'strides' argument to 'max_pool' Op, not %r.HExpected list for 'explicit_paddings' argument to 'max_pool' Op, not %r.r^   )r   re   rf   r`   r   ra   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   max_pool_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   )r   re   rf   r`   r   ra   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                    rQ   max_poolr  Y  s   2 
			0h..0$#\\	11iugui7/1B{$g n 
ED%=	)
	!#(	)* * 5:
:b8R)
:%
:	GdE]	+
	!#*	+, , 9@@"Xr9-@'@gy1'	%e}	5
	!#4	56 6 M^^bx((-@A^^K!!+}=+'88eWg%6*7!QX QK'""$3%%c*GS\\'5Ji0)ll9%':ll./ll=)	+F
 ::L<2('	.a && -
##At,,## 
$
ugw-;  ## 
 ;
 A _sB    #H: J2J74J<:JI((J JJ J/.J/zraw_ops.MaxPoolc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|d}t	        j                  |d	      }t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  gt        j                        \  }	\  } | g}
d
|	d|d|d|d|d	|f}t	        j(                  dd|
|||      }t	        j*                         rt	        j,                  d|
||       |\  }|S c c}w c c}w c c}w )Nr  re   r  rf   r`   r  r   r^   ra   r%   s   MaxPoolrs   rT   r  )rk   rl   rm   r5   r;   r<   rn   rV   rW   rX   rY   rZ   ru   r   r   r   r   r   r   r   r   rA   rG   )r   re   rf   r`   r   ra   r    r!   ro   r[   rP   rO   rJ   s                rQ   r  r    s   	ED%=	)
	!#(	)* * 5:
:b8R)
:%
:	GdE]	+
	!#*	+, , 9@@"Xr9-@'@gy1'	%e}	5
	!#4	56 6 M^^bx((-@A^^K!!+}=+55ugsW\\SZScSceletetv}  wF  wF  HO  HU  HU  W^  Wd  Wd  fm  fs  fs  u|  uB  uB  DK  DP  DP  RY  R`  R`  bi  bo  bo  Er  t{  tC  tC  D'8E,'5)Wi	 1=+O&Z<v!$41'""$<2('	.7 ;
 A _s   H90H>ITV_MaxPool3D_Tc                    t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| d|d|d|d|      }|S t        |t        t        f      st!        d|z        |D 
cg c]  }
t#        j$                  |
d       }}
t        |t        t        f      st!        d	|z        |D 
cg c]  }
t#        j$                  |
d       }}
t#        j&                  |d      }|d
}t#        j&                  |d      }t)        j*                  d| |||||      \  }}}}|dd }t#        j,                         r{d|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t#        j4                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y w xY wc c}
w c c}
w )a  Performs 3D max pooling on the input.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      Shape `[batch, depth, rows, cols, channels]` tensor to pool over.
    ksize: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The size of the window for each dimension of
      the input tensor. Must have `ksize[0] = ksize[4] = 1`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NDHWC", "NCDHW"`. Defaults to `"NDHWC"`.
      The data format of the input and output data. With the
      default format "NDHWC", the data is stored in the order of:
          [batch, in_depth, in_height, in_width, in_channels].
      Alternatively, the format could be "NCDHW", the data storage order is:
          [batch, in_channels, in_depth, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  	MaxPool3Dre   rf   r`   ra   Nrg   >Expected list for 'ksize' argument to 'max_pool3d' Op, not %r.@Expected list for 'strides' argument to 'max_pool3d' Op, not %r.rx   r}   r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   max_pool3d_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rC   rE   rF   rG   r   s                   rQ   
max_pool3dr    sk   2 
			0h..0$#\\11k4	77M;8g n 
ED%=	)
	#%*	+, , 5:
:b8R)
:%
:	GdE]	+
	#%,	-. . 9@@"Xr9-@'@gy1'K!!+}=+'885w$+DJ!QX QK'""$s||G,ill9%y#,,y2IS\\-8#  %'F ::L\674('	.M && -
##At,,## 
&
ugw!$8 8 ## 
 ;
 Arq   zraw_ops.MaxPool3Dc           
         t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|d}t	        j                  |d      }t	        j                  | g|t        j                  t        j                  t        j                  g      \  }\  } | g}	d|d|d|d|d|f
}
t	        j                  d	d
|	|
||      }t	        j                         rt	        j                  d|	|
|       |\  }|S c c}w c c}w )Nr  re   r  rf   r`   rx   ra   r%   s	   MaxPool3Drs   rT   r  rk   rl   rm   r5   r;   r<   rn   rV   rW   rX   rY   rZ   r   rA   rG   r   s               rQ   r  r  !  sw   	ED%=	)
	#%*	+, , 5:
:b8R)
:%
:	GdE]	+
	#%,	-. . 9@@"Xr9-@'@gy1'K!!+}=+55ugsW\\SZScSceletetDwx'8E,UIw	7c7,&\1\#)s?'""$\674('	.) ;
 As   E%0E*TV_MaxPool3DGrad_TTV_MaxPool3DGrad_TInputc                    t         j                   xs t        j                         }|j                  }	|	j                  r%	 t	        j
                  |d|| ||d|d|d|d|      }
|
S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d
}t#        j&                  |d      }t)        j*                  d| |||||||	      \  }}}}|dd }
t#        j,                         rd|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y w xY wc c}w c c}w )a  Computes gradients of 3D max pooling function.

  Args:
    orig_input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      The original input tensor.
    orig_output: A `Tensor`. Must have the same type as `orig_input`.
      The original output tensor.
    grad: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`.
      Output backprop of shape `[batch, depth, rows, cols, channels]`.
    ksize: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The size of the window for each dimension of
      the input tensor. Must have `ksize[0] = ksize[4] = 1`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NDHWC", "NCDHW"`. Defaults to `"NDHWC"`.
      The data format of the input and output data. With the
      default format "NDHWC", the data is stored in the order of:
          [batch, in_depth, in_height, in_width, in_channels].
      Alternatively, the format could be "NCDHW", the data storage order is:
          [batch, in_channels, in_depth, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `grad`.
  MaxPool3DGradre   rf   r`   ra   Nrg   CExpected list for 'ksize' argument to 'max_pool3d_grad' Op, not %r.EExpected list for 'strides' argument to 'max_pool3d_grad' Op, not %r.rx   r  r  r   re   rf   r`   ra   r    r%   TInput)r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   max_pool3d_grad_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rC   rE   rF   rG   r  r  r   re   rf   r`   ra   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                     rQ   max_pool3d_gradr  @  s   : 
			0h..0$#\\	11otZdGy'9g}g n 
ED%=	)
	(*/	01 1 5:
:b8R)
:%
:	GdE]	+
	(*1	23 3 9@@"Xr9-@'@gy1'K!!+}=+'88JK"%!(kN!QX QK'""$s||G,ill9%y#,,y2IS\\-8#  %x1C1CH1MOF ::Lvw8('	.O && -
##At,,## 
+
k4ug{4I I ## 
 ;
 A<    #G0 I)I.0H7HH76H7;I I&%I&zraw_ops.MaxPool3DGradc	                    t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  |d      }|d}t	        j                  |d      }t	        j                  |g|t        j                  t        j                  t        j                  gt        j                        \  }
\  }t	        j                  | |g|t        j                  t        j                  t        j                  gt        j                        \  }}|\  } }| ||g}d|d|d|d|d|
d	|f}t	        j                  d
d||||      }t	        j                         rt	        j                  d|||       |\  }|S c c}	w c c}	w )Nr  re   r  rf   r`   rx   ra   r%   r  s   MaxPool3DGradrs   rT   r  r  )r  r  r   re   rf   r`   ra   r    r!   ro   r[   _attr_TInput_inputs_TInputrP   rO   rJ   s                   rQ   r  r    s   	ED%=	)
	(*/	01 1 5:
:b8R)
:%
:	GdE]	+
	(*1	23 3 9@@"Xr9-@'@gy1'K!!+}=+44dVS7<<QXQaQacjcrcrBuw~  xG  xG  H'7D!)!@!@*kAZ\_bibnbnpw  qA  qA  CJ  CR  CR  bU  W^  Wf  Wf  "g,,:{k40,UIw	7c7HlD&-q#)s?'""$vw8('	.- ;
 Ar  TV_MaxPool3DGradGrad_Tc                    t         j                   xs t        j                         }|j                  }	|	j                  r%	 t	        j
                  |d|| ||d|d|d|d|      }
|
S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d
}t#        j&                  |d      }t)        j*                  d| |||||||	      \  }}}}|dd }
t#        j,                         r{d|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t#        j4                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y w xY wc c}w c c}w )a  Computes second-order gradients of the maxpooling function.

  Args:
    orig_input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      The original input tensor.
    orig_output: A `Tensor`. Must have the same type as `orig_input`.
      The original output tensor.
    grad: A `Tensor`. Must have the same type as `orig_input`.
      Output backprop of shape `[batch, depth, rows, cols, channels]`.
    ksize: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The size of the window for each dimension of
      the input tensor. Must have `ksize[0] = ksize[4] = 1`.
    strides: A list of `ints` that has length `>= 5`.
      1-D tensor of length 5. The stride of the sliding window for each
      dimension of `input`. Must have `strides[0] = strides[4] = 1`.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NDHWC", "NCDHW"`. Defaults to `"NDHWC"`.
      The data format of the input and output data. With the
      default format "NDHWC", the data is stored in the order of:
          [batch, in_depth, in_height, in_width, in_channels].
      Alternatively, the format could be "NCDHW", the data storage order is:
          [batch, in_channels, in_depth, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `orig_input`.
  MaxPool3DGradGradre   rf   r`   ra   Nrg   HExpected list for 'ksize' argument to 'max_pool3d_grad_grad' Op, not %r.JExpected list for 'strides' argument to 'max_pool3d_grad_grad' Op, not %r.rx   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   #max_pool3d_grad_grad_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rC   rE   rF   rG   r  s                     rQ   max_pool3d_grad_gradr    s|   : 
			0h..0$#\\	11!4[$	7Iwg n 
ED%=	)
	-/4	56 6 5:
:b8R)
:%
:	GdE]	+
	-/6	78 8 9@@"Xr9-@'@gy1'K!!+}=+'88
"&eW%,+"&	(!QX
 QK'""$s||G,ill9%y#,,y2IS\\-8#  %'F ::L\67<('	.Q && -
##At,,## 
0
k4ug{4I I ## 
 ;
 A<    #G IIH&2HH&%H&*H> >IIzraw_ops.MaxPool3DGradGradc	                    t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  |d      }|d}t	        j                  |d      }t	        j                  | ||g|t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  g      \  }
}|\  } }}| ||g}d|d|d|d|d|
f
}t	        j*                  d	d
||||      }t	        j,                         rt	        j.                  d|||       |\  }|S c c}	w c c}	w )Nr  re   r  rf   r`   rx   ra   r%   s   MaxPool3DGradGradrs   rT   r  r  r  r  r   re   rf   r`   ra   r    r!   ro   r[   r   rP   rO   rJ   s                  rQ   r  r    sa   	ED%=	)
	-/4	56 6 5:
:b8R)
:%
:	GdE]	+
	-/6	78 8 9@@"Xr9-@'@gy1'K!!+}=+66
KQU7VX[^e^m^movo~o~  AH  AN  AN  PW  P]  P]  _f  _l  _l  nu  nz  nz  |C  |I  |I  KR  K[  K[  ]d  ]k  ]k  mt  my  my  {B  {I  {I  KR  KY  KY  ^\  ]'9$-!:{Dk40,UIw	7c7,&11\#)s?'""$\67<('	.+ ;
 A   G40G9TV_MaxPoolGrad_Tc	                    t         j                   xs t        j                         }	|	j                  }
|
j                  r'	 t	        j
                  |	d|| ||d|d|d|d|d|      }|S t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d
|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|g }t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}|d}t#        j&                  |d      }t)        j*                  d| ||||||||
      \  }}}}|dd }t#        j,                         rd|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f}|j2                  }t#        j4                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	
      S # t        j                  $ r Y Nw xY wc c}w c c}w c c}w )a  Computes gradients of the maxpooling function.

  Args:
    orig_input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      The original input tensor.
    orig_output: A `Tensor`. Must have the same type as `orig_input`.
      The original output tensor.
    grad: A `Tensor`. Must have the same type as `orig_input`.
      4-D.  Gradients w.r.t. the output of `max_pool`.
    ksize: A list of `ints` that has length `>= 4`.
      The size of the window for each dimension of the input tensor.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID", "EXPLICIT"`.
      The type of padding algorithm to use.
    explicit_paddings: An optional list of `ints`. Defaults to `[]`.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `orig_input`.
  MaxPoolGradre   rf   r`   r   ra   Nr  AExpected list for 'ksize' argument to 'max_pool_grad' Op, not %r.CExpected list for 'strides' argument to 'max_pool_grad' Op, not %r.MExpected list for 'explicit_paddings' argument to 'max_pool_grad' Op, not %r.r^   )	r  r  r   re   rf   r`   r   ra   r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   max_pool_grad_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rC   rE   rF   rG   )r  r  r   re   rf   r`   r   ra   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                      rQ   max_pool_gradr  $  s   : 
			0h..0$#\\	11mT:{D'y'9g7J=+7g n 
ED%=	)
	&(-	./ / 5:
:b8R)
:%
:	GdE]	+
	&(/	01 1 9@@"Xr9-@'@gy1'	%e}	5
	&(9	:; ; M^^bx((-@A^^K!!+}=+'88*+ w&:K#.T	;!QX
 QK'""$s||G,ill9%y#,,y2I!3<<0C#DS\\-8#  %	'F
 ::L|VW6('	.c && -
##At,,## 
)
k4ug->!$8 8 ## 
 ;
 A _sB    %H> J8J=6K>JI,,JJ	J J54J5zraw_ops.MaxPoolGradc
                    t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
t	        j                  |d      }|g }t        |t        t        f      st        d|z        |D 
cg c]  }
t	        j
                  |
d       }}
|d}t	        j                  |d	      }t	        j                  | ||g|	t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  gt        j                        \  }}|\  } }}| ||g}d|d|d|d|d	|d
|f}t	        j*                  dd|||	|      }t	        j,                         rt	        j.                  d|||       |\  }|S c c}
w c c}
w c c}
w )Nr  re   r  rf   r`   r  r   r^   ra   r%   s   MaxPoolGradrs   rT   r  r  )r  r  r   re   rf   r`   r   ra   r    r!   ro   r[   r   rP   rO   rJ   s                   rQ   r  r    s   	ED%=	)
	&(-	./ / 5:
:b8R)
:%
:	GdE]	+
	&(/	01 1 9@@"Xr9-@'@gy1'	%e}	5
	&(9	:; ; M^^bx((-@A^^K!!+}=+66
KQU7VX[^e^m^movo~o~  AH  AN  AN  PW  P]  P]  _f  _l  _l  nu  nz  nz  |C  |I  |I  KR  K[  K[  ]d  ]k  ]k  mt  my  my  {B  {I  {I  KR  KY  KY  ^\  ^e  ^m  ^m  n'9$-!:{Dk40,UIw	7(-c	& ^Q|#)s?'""$|VW6('	.; ;
 A _s   I0IITV_MaxPoolGradGrad_Tc                    t         j                   xs t        j                         }|j                  }	|	j                  r%	 t	        j
                  |d|| ||d|d|d|d|      }
|
S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d
}t#        j&                  |d      }t)        j*                  d| |||||||	      \  }}}}|dd }
t#        j,                         r{d|j/                  d      d|j/                  d      d|j/                  d      d|j/                  d      d|j1                  d      f
}|j2                  }t#        j4                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y w xY wc c}w c c}w )ae  Computes second-order gradients of the maxpooling function.

  Args:
    orig_input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      The original input tensor.
    orig_output: A `Tensor`. Must have the same type as `orig_input`.
      The original output tensor.
    grad: A `Tensor`. Must have the same type as `orig_input`.
      4-D.  Gradients of gradients w.r.t. the input of `max_pool`.
    ksize: A list of `ints` that has length `>= 4`.
      The size of the window for each dimension of the input tensor.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `orig_input`.
  MaxPoolGradGradre   rf   r`   ra   Nrg   FExpected list for 'ksize' argument to 'max_pool_grad_grad' Op, not %r.HExpected list for 'strides' argument to 'max_pool_grad_grad' Op, not %r.r^   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   !max_pool_grad_grad_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rC   rE   rF   rG   r  s                     rQ   max_pool_grad_gradr    s|   8 
			0h..0$#\\	11z;gy'9g}g n 
ED%=	)
	+-2	34 4 5:
:b8R)
:%
:	GdE]	+
	+-4	56 6 9@@"Xr9-@'@gy1'K!!+}=+'88jk $E7#* $	&!QX
 QK'""$s||G,ill9%y#,,y2IS\\-8#  %'F ::L<:('	.Q && -
##At,,## 
.
k4ug{4I I ## 
 ;
 Ar  zraw_ops.MaxPoolGradGradc	                    t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  |d      }|d}t	        j                  |d      }t	        j                  | ||g|t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  g      \  }
}|\  } }}| ||g}d|d|d|d|d|
f
}t	        j*                  d	d
||||      }t	        j,                         rt	        j.                  d|||       |\  }|S c c}	w c c}	w )Nr  re   r  rf   r`   r^   ra   r%   s   MaxPoolGradGradrs   rT   r  r  r  s                  rQ   r  r    sa   	ED%=	)
	+-2	34 4 5:
:b8R)
:%
:	GdE]	+
	+-4	56 6 9@@"Xr9-@'@gy1'K!!+}=+66
KQU7VX[^e^m^movo~o~  AH  AN  AN  PW  P]  P]  _f  _l  _l  nu  nz  nz  |C  |I  |I  KR  K[  K[  ]d  ]k  ]k  mt  my  my  {B  {I  {I  KR  KY  KY  ^\  ]'9$-!:{Dk40,UIw	7c7,&/<#)s?'""$<:('	.+ ;
 Ar  TV_MaxPoolGradGradV2_Tre   rf   c                 L   t         j                   xs t        j                         }|j                  }	|	j                  r#	 t	        j
                  |d|| ||||d|d|      }
|
S t        j                  |d      }|d}t        j                  |d      }t        j                   d| |||||||	      \  }}}}|dd }
t        j"                         rYd|j%                  d      d|j%                  d      d|j'                  d      f}|j(                  }t        j*                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y @w xY w)	aK  Computes second-order gradients of the maxpooling function.

  Args:
    orig_input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      The original input tensor.
    orig_output: A `Tensor`. Must have the same type as `orig_input`.
      The original output tensor.
    grad: A `Tensor`. Must have the same type as `orig_input`.
      4-D.  Gradients of gradients w.r.t. the input of `max_pool`.
    ksize: A `Tensor` of type `int32`.
      The size of the window for each dimension of the input tensor.
    strides: A `Tensor` of type `int32`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `orig_input`.
  MaxPoolGradGradV2r`   ra   Nr`   ra   r    r!   r^   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   $max_pool_grad_grad_v2_eager_fallbackr4   r;   rn   r?   r@   rA   rC   rE   rF   rG   r  r  r   re   rf   r`   ra   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                    rQ   max_pool_grad_grad_v2r    s   8 
			0h..0$#\\11!4[$G]KAg n gy1'K!!+}=+'88
"&eW%,+"&	(!QX
 QK'""$i0-ll=)30B0B30GIF::L\67<('	.9 && -
##At,,## 
1
k4!$8 8 ## 
0    !D- -E4 EE43E48F F#"F#zraw_ops.MaxPoolGradGradV2c	                 X   t        j                  |d      }|d}t        j                  |d      }t        j                  | ||g|t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }	}
|
\  } }}t!        j"                  |t        j                        }t!        j"                  |t        j                        }| ||||g}d|d|d|	f}t        j$                  dd||||      }t        j&                         rt        j(                  d|||       |\  }|S )	Nr`   r^   ra   r%   s   MaxPoolGradGradV2rs   rT   r  r;   rn   rV   rW   rZ   ru   r   r   r   r   r   rY   r   rX   r   r   r.   r   r   rA   rG   r  r  r   re   rf   r`   ra   r    r!   r[   r   rP   rO   rJ   s                 rQ   r  r  ]  s   gy1'K!!+}=+66
KQU7VX[^e^m^movo~o~  AH  AN  AN  PW  P]  P]  _f  _l  _l  nu  nz  nz  |C  |I  |I  KR  K[  K[  ]d  ]k  ]k  mt  my  my  {B  {I  {I  KR  KY  KY  ^\  ]'9$-!:{D

 
 
6%""7GMM:'k4@,w{CI&11\#)s?'""$\67<('	.r\   $TV_MaxPoolGradGradWithArgmax_TargmaxTV_MaxPoolGradGradWithArgmax_Targmaxinclude_batch_in_indexc                    t         j                   xs t        j                         }|j                  }	|	j                  r%	 t	        j
                  |d|| ||d|d|d|d|      }
|
S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d
}t#        j(                  |d      }t+        j,                  d| |||||||	      \  }}}}|dd }
t#        j.                         rd|j1                  d      d|j1                  d      d|j1                  d      d|j3                  d      d|j5                  d      d|j5                  d      f}|j6                  }t#        j8                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y w xY wc c}w c c}w )a  Computes second-order gradients of the maxpooling function.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      The original input.
    grad: A `Tensor`. Must have the same type as `input`.
      4-D with shape `[batch, height, width, channels]`.  Gradients w.r.t. the
      input of `max_pool`.
    argmax: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      The indices of the maximum values chosen for each output of `max_pool`.
    ksize: A list of `ints` that has length `>= 4`.
      The size of the window for each dimension of the input tensor.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    include_batch_in_index: An optional `bool`. Defaults to `False`.
      Whether to include batch dimension in flattened index of `argmax`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  MaxPoolGradGradWithArgmaxre   rf   r`   r   Nre   rf   r`   r   r    r!   RExpected list for 'ksize' argument to 'max_pool_grad_grad_with_argmax' Op, not %r.TExpected list for 'strides' argument to 'max_pool_grad_grad_with_argmax' Op, not %r.Fr   r   r  re   rf   r`   r   r    Targmaxr%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   -max_pool_grad_grad_with_argmax_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r>   r?   r@   rA   rC   rD   rE   rF   rG   r   r   r  re   rf   r`   r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                     rQ   max_pool_grad_grad_with_argmaxr
  t  s   2 
			0h..0$#\\	11)4fgy'9g "8:g n 
ED%=	)
	79>	?@ @ 5:
:b8R)
:%
:	GdE]	+
	79@	AB B 9@@"Xr9-@'@gy1'#"#--.DF^_'88#5tF+0'-4<R*.0!QX QK'""$s||G,ill9%y#,,y2I&  !9:I  +S#2D2DS2I	KF
 ::L#\67D('	.U && -
##At,,## 
:
vUGW!7dN N ## 
 ;
 Ar  z!raw_ops.MaxPoolGradGradWithArgmaxc	                 r   t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  |d      }|d}t	        j                  |d      }t	        j                  |g|t        j                  t        j                  g      \  }
\  }t	        j                  | |g|t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j                  t        j"                  t        j$                  t        j&                  t        j(                  t        j*                  g      \  }}|\  } }| ||g}d|d|d|d|d|
d	|f}t	        j,                  d
d||||      }t	        j.                         rt	        j0                  d|||       |\  }|S c c}	w c c}	w )Nr  re   r  rf   r`   Fr   r  r%   s   MaxPoolGradGradWithArgmaxrs   rT   r  rk   rl   rm   r5   r;   r<   rn   r>   rV   rW   r   r   rZ   ru   r   r   r   rY   r   rX   r   r   r   rA   rG   r   r   r  re   rf   r`   r   r    r!   ro   _attr_Targmaxr[   r   rP   rO   rJ   s                   rQ   r  r    s   	ED%=	)
	79>	?@ @ 5:
:b8R)
:%
:	GdE]	+
	79@	AB B 9@@"Xr9-@'@gy1'#"#--.DF^_%<<fXsW]]\c\i\iLlm-&66t}cGOO]d]l]lnun{n{  ~E  ~K  ~K  MT  MZ  MZ  \c  \h  \h  jq  jw  jw  y@  yI  yI  KR  KY  KY  [b  [g  [g  ip  iw  iw  y@  yG  yG  LJ  K'9-5$v&,UIw	72I}w& 91$0C"&(' ""$#\67D('	.1 ;
 A   H/0H4TV_MaxPoolGradV2_Tc                 L   t         j                   xs t        j                         }|j                  }	|	j                  r#	 t	        j
                  |d|| ||||d|d|      }
|
S t        j                  |d      }|d}t        j                  |d      }t        j                   d| |||||||	      \  }}}}|dd }
t        j"                         rYd|j%                  d      d|j%                  d      d|j'                  d      f}|j(                  }t        j*                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y @w xY w)	a2  Computes gradients of the maxpooling function.

  Args:
    orig_input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      The original input tensor.
    orig_output: A `Tensor`. Must have the same type as `orig_input`.
      The original output tensor.
    grad: A `Tensor`. Must have the same type as `orig_input`.
      4-D.  Gradients w.r.t. the output of `max_pool`.
    ksize: A `Tensor` of type `int32`.
      The size of the window for each dimension of the input tensor.
    strides: A `Tensor` of type `int32`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NHWC", "NCHW"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `orig_input`.
  MaxPoolGradV2r`   ra   Nr  r^   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   max_pool_grad_v2_eager_fallbackr4   r;   rn   r?   r@   rA   rC   rE   rF   rG   r  s                    rQ   max_pool_grad_v2r    s   8 
			0h..0$#\\11otZdEG]KAg n gy1'K!!+}=+'88JK"%!(kN!QX QK'""$i0-ll=)30B0B30GIF::Lvw8('	.7 && -
##At,,## 
,
k4!$8 8 ## 
r  zraw_ops.MaxPoolGradV2c	                 v   t        j                  |d      }|d}t        j                  |d      }t        j                  | ||g|t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  gt        j                        \  }	}
|
\  } }}t!        j"                  |t        j                        }t!        j"                  |t        j                        }| ||||g}d|d|d|	f}t        j$                  dd||||      }t        j&                         rt        j(                  d|||       |\  }|S )	Nr`   r^   ra   r%   s   MaxPoolGradV2rs   rT   r  r  r  s                 rQ   r  r  +  s   gy1'K!!+}=+66
KQU7VX[^e^m^movo~o~  AH  AN  AN  PW  P]  P]  _f  _l  _l  nu  nz  nz  |C  |I  |I  KR  K[  K[  ]d  ]k  ]k  mt  my  my  {B  {I  {I  KR  KY  KY  ^\  ^e  ^m  ^m  n'9$-!:{D

 
 
6%""7GMM:'k4@,w{CI&-q#)s?'""$vw8('	.r\    TV_MaxPoolGradWithArgmax_TargmaxTV_MaxPoolGradWithArgmax_Tc                    t         j                   xs t        j                         }|j                  }	|	j                  r%	 t	        j
                  |d|| ||d|d|d|d|      }
|
S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}t        |t        t        f      st!        d	|z        |D cg c]  }t#        j$                  |d       }}t#        j&                  |d      }|d
}t#        j(                  |d      }t+        j,                  d| |||||||	      \  }}}}|dd }
t#        j.                         rd|j1                  d      d|j1                  d      d|j1                  d      d|j3                  d      d|j5                  d      d|j5                  d      f}|j6                  }t#        j8                  d|||
       |
\  }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y w xY wc c}w c c}w )a  Computes gradients of the maxpooling function.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      The original input.
    grad: A `Tensor`. Must have the same type as `input`.
      4-D with shape `[batch, height, width, channels]`.  Gradients w.r.t. the
      output of `max_pool`.
    argmax: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      The indices of the maximum values chosen for each output of `max_pool`.
    ksize: A list of `ints` that has length `>= 4`.
      The size of the window for each dimension of the input tensor.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    include_batch_in_index: An optional `bool`. Defaults to `False`.
      Whether to include batch dimension in flattened index of `argmax`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  MaxPoolGradWithArgmaxre   rf   r`   r   Nr  MExpected list for 'ksize' argument to 'max_pool_grad_with_argmax' Op, not %r.OExpected list for 'strides' argument to 'max_pool_grad_with_argmax' Op, not %r.Fr  r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   (max_pool_grad_with_argmax_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r>   r?   r@   rA   rC   rD   rE   rF   rG   r	  s                     rQ   max_pool_grad_with_argmaxr  B  s   2 
			0h..0$#\\	11%tUD&'y'9g "8:g n 
ED%=	)
	249	:; ; 5:
:b8R)
:%
:	GdE]	+
	24;	<= = 9@@"Xr9-@'@gy1'#"#--.DF^_'88u4',g)08N&*,!QX QK'""$s||G,ill9%y#,,y2I&  !9:I  +S#2D2DS2I	KF
 ::Lvw@('	.U && -
##At,,## 
5
vUGW!7dN N ## 
 ;
 Ar  zraw_ops.MaxPoolGradWithArgmaxc	                 r   t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t        |t        t        f      st        d|z        |D 	cg c]  }	t	        j
                  |	d       }}	t	        j                  |d      }|d}t	        j                  |d      }t	        j                  |g|t        j                  t        j                  g      \  }
\  }t	        j                  | |g|t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j                  t        j"                  t        j$                  t        j&                  t        j(                  t        j*                  g      \  }}|\  } }| ||g}d|d|d|d|d|
d	|f}t	        j,                  d
d||||      }t	        j.                         rt	        j0                  d|||       |\  }|S c c}	w c c}	w )Nr  re   r  rf   r`   Fr   r  r%   s   MaxPoolGradWithArgmaxrs   rT   r  r  r  s                   rQ   r  r    s   	ED%=	)
	249	:; ; 5:
:b8R)
:%
:	GdE]	+
	24;	<= = 9@@"Xr9-@'@gy1'#"#--.DF^_%<<fXsW]]\c\i\iLlm-&66t}cGOO]d]l]lnun{n{  ~E  ~K  ~K  MT  MZ  MZ  \c  \h  \h  jq  jw  jw  y@  yI  yI  KR  KY  KY  [b  [g  [g  ip  iw  iw  y@  yG  yG  LJ  K'9-5$v&,UIw	72I}w& 5q#)s?'""$vw@('	./ ;
 Ar  TV_MaxPoolV2_Tc                 @   t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| ||d|d|
      }|S t        j                  |d      }|d}t        j                  |d      }t        j                   d| |||||      \  }
}
}}|dd }t        j"                         rYd|j%                  d      d|j'                  d      d|j'                  d      f}|j(                  }t        j*                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y <w xY w)	a?  Performs max pooling on the input.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, `qint8`.
      4-D input to pool over.
    ksize: A `Tensor` of type `int32`.
      The size of the window for each dimension of the input tensor.
    strides: A `Tensor` of type `int32`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    data_format: An optional `string` from: `"NHWC", "NCHW", "NCHW_VECT_C"`. Defaults to `"NHWC"`.
      Specify the data format of the input and output data. With the
      default format "NHWC", the data is stored in the order of:
          [batch, in_height, in_width, in_channels].
      Alternatively, the format could be "NCHW", the data storage order of:
          [batch, in_channels, in_height, in_width].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  	MaxPoolV2r`   ra   Nr  r^   r}   r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   max_pool_v2_eager_fallbackr4   r;   rn   r?   r@   rA   rE   rC   rF   rG   )r   re   rf   r`   ra   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                  rQ   max_pool_v2r#    s   0 
			0h..0$#\\11k4w	7{$g n gy1'K!!+}=+'885w$+DJ!QX QK'""$3%%c*Ill9%}ll=)+F ::L\674('	.7 && -
##At,,## 
'
k  ## 
s0    D) )E0<EE0/E04F FFzraw_ops.MaxPoolV2c                 H   t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  gt        j                        \  }\  } t        j                   |t        j                        }t        j                   |t        j                        }| ||g}d|d|d|f}	t        j"                  dd||	||      }
t        j$                         rt        j&                  d||	|
       |
\  }
|
S )	Nr`   r^   ra   r%   s	   MaxPoolV2rs   rT   r!  )r;   rn   rV   rW   rX   rY   rZ   ru   r   r   r   r   r   r   r   r.   r   r   rA   rG   )r   re   rf   r`   ra   r    r!   r[   rP   rO   rJ   s              rQ   r"  r"    s   gy1'K!!+}=+55ugsW\\SZScSceletetv}  wF  wF  HO  HU  HU  W^  Wd  Wd  fm  fs  fs  u|  uB  uB  DK  DP  DP  RY  R`  R`  bi  bo  bo  Er  t{  tC  tC  D'8E

 
 
6%""7GMM:'(,)Wm[I&\1\#)s?'""$\674('	.r\   MaxPoolWithArgmaxTV_MaxPoolWithArgmax_TargmaxTV_MaxPoolWithArgmax_Tr  c                 ~   t         j                   xs t        j                         }|j                  }|j                  r:	 t	        j
                  |d|| d|d|d|d|d|      }	t        j                  |	      }	|	S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t        |t         t"        f      st%        d
|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|t,        j.                  }t'        j0                  |d      }|d}t'        j2                  |d      }t5        j6                  d| ||||||      \  }}}}|dd }	t'        j8                         rd|j;                  d      d|j;                  d      d|j=                  d      d|j;                  d      d|j?                  d      d|j=                  d      f}|j@                  }t'        jB                  d|||	       t        j                  |	      }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y 8w xY wc c}w c c}w )a  Performs max pooling on the input and outputs both max values and indices.

  The indices in `argmax` are flattened, so that a maximum value at position
  `[b, y, x, c]` becomes flattened index:
  `(y * width + x) * channels + c` if `include_batch_in_index` is False;
  `((b * height + y) * width + x) * channels + c` if `include_batch_in_index` is True.

  The indices returned are always in `[0, height) x [0, width)` before flattening,
  even if padding is involved and the mathematically correct answer is outside
  (either negative or too large).  This is a bug, but fixing it is difficult to do
  in a safe backwards compatible way, especially due to flattening.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      4-D with shape `[batch, height, width, channels]`.  Input to pool over.
    ksize: A list of `ints` that has length `>= 4`.
      The size of the window for each dimension of the input tensor.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    Targmax: An optional `tf.DType` from: `tf.int32, tf.int64`. Defaults to `tf.int64`.
    include_batch_in_index: An optional `bool`. Defaults to `False`.
      Whether to include batch dimension in flattened index of `argmax`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, argmax).

    output: A `Tensor`. Has the same type as `input`.
    argmax: A `Tensor` of type `Targmax`.
  r%  re   rf   r  r`   r   N)re   rf   r  r`   r   r    r!   HExpected list for 'ksize' argument to 'max_pool_with_argmax' Op, not %r.JExpected list for 'strides' argument to 'max_pool_with_argmax' Op, not %r.F)r   re   rf   r`   r  r   r    r%   )"r&   r   r'   r(   r   r)   _MaxPoolWithArgmaxOutputr+   r,   r-   r.   r/   r0   #max_pool_with_argmax_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r>   r?   r@   rA   rC   rE   rD   rF   rG   )r   re   rf   r`   r  r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                    rQ   max_pool_with_argmaxr-    s   D 
			0h..0$#\\
11!4	GY "8:g )..w7gn 
ED%=	)
	-/4	56 6 5:
:b8R)
:%
:	GdE]	+
	-/6	78 8 9@@"Xr9-@'@gy1'_mmGw	2'#"#--.DF^_'885w%,g4J"&	(!QX
 QK'""$s||G,ill9%y  +Yll9%'?  !9:C  %'F ::L\67<$**73'	.] && -
##At,,## 
0
ugw2H  ## 
 ;
 As<    8H= !J5(J:=JI++JJJ J21J2zraw_ops.MaxPoolWithArgmaxc                 b   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|t        j                  }t	        j                  |d      }|d}t	        j                  |d      }t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j                  t        j$                  t        j&                  t        j(                  t        j*                  t        j,                  g      \  }	\  } | g}
d|d|d|d|d|d	|	f}t	        j.                  d
d|
|||      }t	        j0                         rt	        j2                  d|
||       t4        j7                  |      }|S c c}w c c}w )Nr)  re   r*  rf   r`   r  Fr   r%   s   MaxPoolWithArgmaxrS   rT   r%  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r>   rV   rZ   ru   r   r   r   r   rY   r   rX   r   r   r   rA   rG   r+  r+   )r   re   rf   r`   r  r   r    r!   ro   r[   rP   rO   rJ   s                rQ   r,  r,  m  sl   	ED%=	)
	-/4	56 6 5:
:b8R)
:%
:	GdE]	+
	-/6	78 8 9@@"Xr9-@'@gy1'_mmGw	2'#"#--.DF^_55ugsW__V]VeVegngtgtv}  wD  wD  FM  FS  FS  U\  Ua  Ua  cj  cp  cp  ry  rB  rB  DK  DR  DR  T[  T`  T`  bi  bp  bp  ry  r@  r@  EC  D'8E,UIw	7I	#%;S'K&11\#)s?'""$\67<$**73'	./ ;
 As   H'0H,TV_NthElement_Tnreversec           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |d}t        j                  |d      }t        j                   d| |||      \  }}}	}
|
dd }t        j"                         rHd|	j%                  d      d|	j'                  d      f}|	j(                  }t        j*                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a>  Finds values of the `n`-th order statistic for the last dimension.

  If the input is a vector (rank-1), finds the entries which is the nth-smallest
  value in the vector and outputs their values as scalar tensor.

  For matrices (resp. higher rank input), computes the entries which is the
  nth-smallest value in each row (resp. vector along the last dimension). Thus,

      values.shape = input.shape[:-1]

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      1-D or higher with last dimension at least `n+1`.
    n: A `Tensor` of type `int32`.
      0-D. Position of sorted vector to select along the last dimension (along
      each row for matrices). Valid range of n is `[0, input.shape[:-1])`
    reverse: An optional `bool`. Defaults to `False`.
      When set to True, find the nth-largest value in the vector and vice
      versa.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  
NthElementr1  N)r1  r    r!   F)r   r0  r1  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   nth_element_eager_fallbackr4   r;   r>   r?   r@   rA   rD   rE   rF   rG   )r   r0  r1  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                rQ   nth_elementr5    su   2 
			0h..0$#\\11lD%Iw@gn _Gw	2''88EQdD!QXQK'""$++I6  %'F::LlFG5('	./ && -
##At,,## 
'
G$D: :## 
r   zraw_ops.NthElementc                    |d}t        j                  |d      }t        j                  | g|t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t!        j"                  |t        j                        }| |g}d|d|f}t        j$                  dd||||      }t        j&                         rt        j(                  d|||       |\  }|S )NFr1  r%   s
   NthElementrs   rT   r3  )r;   r>   rV   rW   rZ   ru   r   r   r   r   r   rY   r   rX   r   r   r.   r   r   rA   rG   )	r   r0  r1  r    r!   r[   rP   rO   rJ   s	            rQ   r4  r4    s   _Gw	2'55ugsW__V]VeVegngtgtv}  wD  wD  FM  FS  FS  U\  Ua  Ua  cj  cp  cp  ry  rB  rB  DK  DR  DR  T[  T`  T`  bi  bp  bp  ry  r@  r@  EC  D'8E
Q.!,wW-&]Al#)s?'""$lFG5('	.r\   QuantizedAvgPool)r  
min_output
max_outputTV_QuantizedAvgPool_T	min_input	max_inputc                    t         j                   xs t        j                         }|j                  }|j                  r8	 t	        j
                  |d|| ||d|d|d|      }	t        j                  |	      }	|	S t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }t-        j.                  d| ||||||	      \  }}}}|dd }	t'        j0                         rjd
|j3                  d
      d|j5                  d      d|j5                  d      d|j5                  d      f}|j6                  }t'        j8                  d|||	       t        j                  |	      }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w c c}w )a  Produces the average pool of the input tensor for quantized types.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      4-D with shape `[batch, height, width, channels]`.
    min_input: A `Tensor` of type `float32`.
      The float value that the lowest quantized input value represents.
    max_input: A `Tensor` of type `float32`.
      The float value that the highest quantized input value represents.
    ksize: A list of `ints`.
      The size of the window for each dimension of the input tensor.
      The length must be 4 to match the number of dimensions of the input.
    strides: A list of `ints`.
      The stride of the sliding window for each dimension of the input
      tensor.  The length must be 4 to match the number of dimensions of the input.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor`. Has the same type as `input`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r7  re   rf   r`   Nre   rf   r`   r    r!   FExpected list for 'ksize' argument to 'quantized_avg_pool' Op, not %r.HExpected list for 'strides' argument to 'quantized_avg_pool' Op, not %r.r   r;  r<  re   rf   r`   r    r%   )r&   r   r'   r(   r   r)   _QuantizedAvgPoolOutputr+   r,   r-   r.   r/   r0   !quantized_avg_pool_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   r   r;  r<  re   rf   r`   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                    rQ   quantized_avg_poolrE    ^   6 
			0h..0$#\\	11 $y)Wy'9g7g (--g6gn 
ED%=	)
	+-2	34 4 5:
:b8R)
:%
:	GdE]	+
	+-4	56 6 9@@"Xr9-@'@gy1''88%9&/ug$+$8!QX QK'""$3%%c*GS\\'5Ji0)ll9%'F ::LL&';#))'2'	.G && -
##At,,## 
.
IUG$0 0 ## 
 ;
 A<    6G I&IH*HHH"H5 5IIzraw_ops.QuantizedAvgPoolc           	         t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }	\  } t        j                  |t        j                         }t        j                  |t        j                         }| ||g}
d|	d|d|d|f}t	        j"                  dd|
|||	      }t	        j$                         rt	        j&                  d
|
||       t(        j+                  |      }|S c c}w c c}w )Nr?  re   r@  rf   r`   r%   s   QuantizedAvgPoolr  rT   r7  )rk   rl   rm   r5   r;   r<   rn   rV   rW   r   r   r   r   r   r.   r   rZ   r   rA   rG   rB  r+   r   r;  r<  re   rf   r`   r    r!   ro   r[   rP   rO   rJ   s                rQ   rC  rC  -     	ED%=	)
	+-2	34 4 5:
:b8R)
:%
:	GdE]	+
	+-4	56 6 9@@"Xr9-@'@gy1'55ugsW]]T[TbTbdkdrdrt{  uC  uC  EL  ET  ET  EW  X'8E$$Y@)$$Y@)I.,'5)Wi	&0!L#)s?'""$L&';#))'2'	.' ;
 A   G0G)QuantizedBatchNormWithGlobalNormalization)result
result_min
result_max3TV_QuantizedBatchNormWithGlobalNormalization_Tinput5TV_QuantizedBatchNormWithGlobalNormalization_out_typet_mint_maxm_minm_maxv_minv_maxbeta_minbeta_max	gamma_min	gamma_maxout_typec                 j   t         j                   xs t        j                         }|j                  }|j                  rD	 t	        j
                  |d|| |||||||||	|
||||d|d|d|      }t        j                  |      }|S t        j                   |d      }t        j"                  |d      }t        j$                  |d      }t'        j(                  	 di d| d|d	|d
|d|d|d|d|d|d|	d|
d|d|d|d|d|d|d|d|\  }}}}|dd }t        j*                         rjd|j-                  d      d|j-                  d      d|j/                  d      d|j1                  d      f}|j2                  }t        j4                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
|||||||||      S # t        j                  $ r Y w xY w)a
  Quantized Batch normalization.

  This op is deprecated and will be removed in the future. Prefer
  `tf.nn.batch_normalization`.

  Args:
    t: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      A 4D input Tensor.
    t_min: A `Tensor` of type `float32`.
      The value represented by the lowest quantized input.
    t_max: A `Tensor` of type `float32`.
      The value represented by the highest quantized input.
    m: A `Tensor`. Must have the same type as `t`.
      A 1D mean Tensor with size matching the last dimension of t.
      This is the first output from tf.nn.moments,
      or a saved moving average thereof.
    m_min: A `Tensor` of type `float32`.
      The value represented by the lowest quantized mean.
    m_max: A `Tensor` of type `float32`.
      The value represented by the highest quantized mean.
    v: A `Tensor`. Must have the same type as `t`.
      A 1D variance Tensor with size matching the last dimension of t.
      This is the second output from tf.nn.moments,
      or a saved moving average thereof.
    v_min: A `Tensor` of type `float32`.
      The value represented by the lowest quantized variance.
    v_max: A `Tensor` of type `float32`.
      The value represented by the highest quantized variance.
    beta: A `Tensor`. Must have the same type as `t`.
      A 1D beta Tensor with size matching the last dimension of t.
      An offset to be added to the normalized tensor.
    beta_min: A `Tensor` of type `float32`.
      The value represented by the lowest quantized offset.
    beta_max: A `Tensor` of type `float32`.
      The value represented by the highest quantized offset.
    gamma: A `Tensor`. Must have the same type as `t`.
      A 1D gamma Tensor with size matching the last dimension of t.
      If "scale_after_normalization" is true, this tensor will be multiplied
      with the normalized tensor.
    gamma_min: A `Tensor` of type `float32`.
      The value represented by the lowest quantized gamma.
    gamma_max: A `Tensor` of type `float32`.
      The value represented by the highest quantized gamma.
    out_type: A `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`.
    variance_epsilon: A `float`. A small float number to avoid dividing by 0.
    scale_after_normalization: A `bool`.
      A bool indicating whether the resulted tensor
      needs to be multiplied with gamma.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (result, result_min, result_max).

    result: A `Tensor` of type `out_type`.
    result_min: A `Tensor` of type `float32`.
    result_max: A `Tensor` of type `float32`.
  rL  r\  r   r   N)r\  r   r   r    r!   r   rR  rS  r   rT  rU  r   rV  rW  r   rX  rY  r   rZ  r[  r    Tinput)rL  )r&   r   r'   r(   r   r)   0_QuantizedBatchNormWithGlobalNormalizationOutputr+   r,   r-   r.   r/   r0   =quantized_batch_norm_with_global_normalization_eager_fallbackr4   r;   r{  r=   r>   r?   r@   rA   rE   rC   rD   rF   rG   )r   rR  rS  r   rT  rU  r   rV  rW  r   rX  rY  r   rZ  r[  r\  r   r   r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                               rQ   .quantized_batch_norm_with_global_normalizationra  O  s   t 
			0h..0$#\\1194Eq%5%xy)Z;M5!#g AFFwOgn *5((()9;MN&001JLgh'883@78@@E@;@@DE@ <A@ IN@ 89	@ AF	@
 <A@
 HL@ ?G@ ?G@ <A@ @I@ @I@ ?G@ GW@ Pi@ ;?@!QX QK'""$**84j  ,.@ll-.0K  !<=?F ::L3\67T<BB7K'	.U && -
##At,,## 
J
UE1eUAueT8
E9i(+$=D  ## 
s1    AF1 1G8GG87G8<H H21H2z1raw_ops.QuantizedBatchNormWithGlobalNormalizationc                 ,   t        j                  |d      }t        j                  |d      }t        j                  |d      }t        j                  | |||	|g|t
        j                  t
        j                  t
        j                  t
        j                  t
        j                  g      \  }}|\  } }}}	}t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |
t
        j                        }
t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }| |||||||||	|
||||g}d|d|d|d|f}t        j                  dd||||      }t        j                         rt        j                   d|||       t"        j%                  |      }|S )	Nr\  r   r   r^  s)   QuantizedBatchNormWithGlobalNormalizationr  rT   rL  )r;   r{  r=   r>   rV   rW   r   r   r   r   r   r.   r   rZ   r   rA   rG   r_  r+   )r   rR  rS  r   rT  rU  r   rV  rW  r   rX  rY  r   rZ  r[  r\  r   r   r    r!   _attr_Tinput_inputs_TinputrP   rO   rJ   s                            rQ   r`  r`    sH   *5((()9;MN&001JLgh!)!@!@!Q4QVAWY\_f_l_lnun|n|  F  M  M  OV  O]  O]  _f  _n  _n  _q  "r,)1aD%

 
 
8%

 
 
8%

 
 
8%

 
 
8%

 
 
8%

 
 
8%##Hgoo>(##Hgoo>($$Y@)$$Y@)UE1eUAueT8U]_dfoqz{,lJ:L/1JL&I1$0C"&(' ""$3\67T<BB7K'	.r\   QuantizedBiasAdd)r  min_outmax_outTV_QuantizedBiasAdd_T1TV_QuantizedBiasAdd_T2TV_QuantizedBiasAdd_out_typemin_biasmax_biasc                 b   t         j                   xs t        j                         }|j                  }	|	j                  r7	 t	        j
                  |d|| |||||d|      }
t        j                  |
      }
|
S t        j                   |d      }t#        j$                  d| |||||||	      \  }}}}|dd }
t        j&                         rYd|j)                  d      d|j)                  d      d|j)                  d      f}|j*                  }t        j,                  d|||
       t        j                  |
      }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y 7w xY w)a  Adds Tensor 'bias' to Tensor 'input' for Quantized types.

  Broadcasts the values of bias on dimensions 0..N-2 of 'input'.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    bias: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      A 1D bias Tensor with size matching the last dimension of 'input'.
    min_input: A `Tensor` of type `float32`.
      The float value that the lowest quantized input value represents.
    max_input: A `Tensor` of type `float32`.
      The float value that the highest quantized input value represents.
    min_bias: A `Tensor` of type `float32`.
      The float value that the lowest quantized bias value represents.
    max_bias: A `Tensor` of type `float32`.
      The float value that the highest quantized bias value represents.
    out_type: A `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_out, max_out).

    output: A `Tensor` of type `out_type`.
    min_out: A `Tensor` of type `float32`.
    max_out: A `Tensor` of type `float32`.
  re  r\  Nr\  r    r!   )r   r   r;  r<  rk  rl  r\  r    T1T2)r&   r   r'   r(   r   r)   _QuantizedBiasAddOutputr+   r,   r-   r.   r/   r0   !quantized_bias_add_eager_fallbackr4   r;   r{  r?   r@   rA   rE   rF   rG   )r   r   r;  r<  rk  rl  r\  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                    rQ   quantized_bias_addrs    s   6 
			0h..0$#\\	11 $tY	(J2g (--g6gn *5('88%di&/(%-tM!QX QK'""$C&&t,dC4F4Ft4L#,,Z8:F::LL&';#))'2'	.1 && -
##At,,## 
.
y)Xx$D2 2 ## 
s0    5D8 8E?E&&E?>E?F F.-F.zraw_ops.QuantizedBiasAddc	           	         t        j                  |d      }t        j                  | g|t        j                  t        j
                  t        j                  t        j                  t        j                  g      \  }	\  } t        j                  |g|t        j                  t        j
                  t        j                  t        j                  t        j                  g      \  }
\  }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }| |||||g}d|	d|
d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       t        j!                  |      }|S )Nr\  ro  rp  s   QuantizedBiasAddr  rT   re  )r;   r{  rV   rW   r   r   r   r   r   r.   r   rZ   r   rA   rG   rq  r+   )r   r   r;  r<  rk  rl  r\  r    r!   _attr_T1_attr_T2rP   rO   rJ   s                 rQ   rr  rr  *  s   *5(66wgmmU\UcUcelesesu|  vD  vD  FM  FU  FU  FX  Y(HU55tfcGMMSZSaSacjcqcqsz  tB  tB  DK  DS  DS  DV  W(GT$$Y@)$$Y@)##Hgoo>(##Hgoo>(y)XxH,(D(JA&0!L#)s?'""$L&';#))'2'	.r\   QuantizedConv2DTV_QuantizedConv2D_TinputTV_QuantizedConv2D_TfilterTV_QuantizedConv2D_out_type
min_filter
max_filterc                 l   t         j                   xs t        j                         }|j                  }|j                  r=	 t	        j
                  |d|
| |||||d|d|d|d|	      }t        j                  |      }|S t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|t,        j.                  }t'        j0                  |d      }|	g d	}	t        |	t         t"        f      st%        d
|	z        |	D cg c]  }t'        j(                  |d       }	}t3        j4                  d| |||||||||	|
      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||
       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
|      S # t        j                  $ r Y ,w xY wc c}w c c}w )ap  Computes a 2D convolution given quantized 4D input and filter tensors.

  The inputs are quantized tensors where the lowest value represents the real
  number of the associated minimum, and the highest represents the maximum.
  This means that you can only interpret the quantized output in the same way, by
  taking the returned minimum and maximum values into account.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      filter's input_depth dimension must match input's depth dimensions.
    min_input: A `Tensor` of type `float32`.
      The float value that the lowest quantized input value represents.
    max_input: A `Tensor` of type `float32`.
      The float value that the highest quantized input value represents.
    min_filter: A `Tensor` of type `float32`.
      The float value that the lowest quantized filter value represents.
    max_filter: A `Tensor` of type `float32`.
      The float value that the highest quantized filter value represents.
    strides: A list of `ints`.
      The stride of the sliding window for each dimension of the input
      tensor.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      1-D tensor of length 4.  The dilation factor for each dimension of
      `input`. If set to k > 1, there will be k-1 skipped cells between each
      filter element on that dimension. The dimension order is determined by the
      value of `data_format`, see above for details. Dilations in the batch and
      depth dimensions must be 1.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  rw  r\  rf   r`   r   Nr\  rf   r`   r   r    r!   FExpected list for 'strides' argument to 'quantized_conv2d' Op, not %r.r   HExpected list for 'dilations' argument to 'quantized_conv2d' Op, not %r.r   r   r;  r<  r{  r|  rf   r`   r\  r   r    r^  Tfilter) r&   r   r'   r(   r   r)   _QuantizedConv2DOutputr+   r,   r-   r.   r/   r0   quantized_conv2d_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r   r   r;  r<  r{  r|  rf   r`   r\  r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                        rQ   quantized_conv2dr  E  s   R 
			0h..0$#\\
11ufiJ
Hi7K4g ',,W5gn 
GdE]	+
	)+2	34 4 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	)+4	56 6 =FFbx  [1F)F'88v%.:&0'#*X%.T;!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4	6F
 ::L<:"((1'	.[ && -
##At,,## 
,
Iz:WgDd4 4 ## 
 A G<    ;H0 $J,/J10I7II76I7;J J)(J)zraw_ops.QuantizedConv2Dc                 b   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|t        j                  }t	        j                  |d      }|	g d}	t        |	t        t        f      st        d|	z        |	D cg c]  }t	        j
                  |d       }	}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| |||||g}d|d	|d|d|d|d|	f}t	        j$                  d
d||||
      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w )Nr  rf   r`   r\  r   r  r   r^  r  s   QuantizedConv2Dr  rT   rw  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   r   r   r;  r<  r{  r|  rf   r`   r\  r   r    r!   ro   rc  _attr_TfilterrP   rO   rJ   s                     rQ   r  r    s   	GdE]	+
	)+2	34 4 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	)+4	56 6 =FFbx  [1F)F#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&$$Y@)$$Y@)%%j'//B*%%j'//B*Iz:N,lI}j
Iw	7KL&/<#)s?'""$<:"((1'	.7 A G   J'4J,QuantizedConv2DAndRelu TV_QuantizedConv2DAndRelu_Tinput!TV_QuantizedConv2DAndRelu_Tfilter"TV_QuantizedConv2DAndRelu_out_typec                 6   t         j                   xs t        j                         }|j                  }|j                  r?	 t	        j
                  |d|| |||||d|d|d|d|	d|
      }t        j                  |      }|S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|t,        j.                  }t'        j0                  |d      }|	g d
}	t        |	t         t"        f      st%        d|	z        |	D cg c]  }t'        j(                  |d       }	}|
g }
t        |
t         t"        f      st%        d|
z        |
D cg c]  }t'        j(                  |d       }
}t3        j4                  d| |||||||||	|
|      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )a  TODO: add doc.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    min_input: A `Tensor` of type `float32`.
    max_input: A `Tensor` of type `float32`.
    min_filter: A `Tensor` of type `float32`.
    max_filter: A `Tensor` of type `float32`.
    strides: A list of `ints`.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  r\  rf   r`   r   padding_listNr\  rf   r`   r   r  r    r!   OExpected list for 'strides' argument to 'quantized_conv2d_and_relu' Op, not %r.r   QExpected list for 'dilations' argument to 'quantized_conv2d_and_relu' Op, not %r.TExpected list for 'padding_list' argument to 'quantized_conv2d_and_relu' Op, not %r.)r   r   r;  r<  r{  r|  rf   r`   r\  r   r  r    r^  r  ) r&   r   r'   r(   r   r)   _QuantizedConv2DAndReluOutputr+   r,   r-   r.   r/   r0   (quantized_conv2d_and_relu_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   )r   r   r;  r<  r{  r|  rf   r`   r\  r   r  r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                         rQ   quantized_conv2d_and_relur    sG   0 
			0h..0$#\\11&eVY:z:xG[)^	g
 .33G<gn 
GdE]	+
	24;	<= = 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	24=	>? ? =FFbx  [1F)FL	L4-	0
	24@	AB B COOB(##B7O,O'88 f,5-7-7*1H,5/;$H!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4nll>*,F ::L ,A)//8'	.o && -
##At,,## 
5
Iz:WgLtO O ## 
 A G PsB    =J &L1L<LK"J==KKK2 2L	L	zraw_ops.QuantizedConv2DAndReluc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|t        j                  }t	        j                  |d      }|	g d}	t        |	t        t        f      st        d|	z        |	D cg c]  }t	        j
                  |d       }	}|
g }
t        |
t        t        f      st        d|
z        |
D cg c]  }t	        j
                  |d	       }
}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| |||||g}d
|d|d|d|d|d|	d	|
f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr  rf   r`   r\  r   r  r   r  r  r^  r  s   QuantizedConv2DAndRelur  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   )r   r   r;  r<  r{  r|  rf   r`   r\  r   r  r    r!   ro   rc  r  rP   rO   rJ   s                      rQ   r  r  4   s   	GdE]	+
	24;	<= = 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	24=	>? ? =FFbx  [1F)FL	L4-	0
	24@	AB B COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&$$Y@)$$Y@)%%j'//B*%%j'//B*Iz:N,lI}j
Iw	7K, & 6$0C"&(' ""$ ,A)//8'	.I A G Ps   K44K9?K>#QuantizedConv2DAndReluAndRequantize-TV_QuantizedConv2DAndReluAndRequantize_Tinput.TV_QuantizedConv2DAndReluAndRequantize_Tfilter/TV_QuantizedConv2DAndReluAndRequantize_out_typemin_freezed_outputmax_freezed_outputc                 B   t         j                   xs t        j                         }|j                  }|j                  rA	 t	        j
                  |d|| |||||||d|
d|d|	d|d|      }t        j                  |      }|S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |	d      }	|
t,        j.                  }
t'        j0                  |
d      }
|g d
}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  d| |||||||||	|
|||      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||
||	||||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )ap  TODO: add doc.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    min_input: A `Tensor` of type `float32`.
    max_input: A `Tensor` of type `float32`.
    min_filter: A `Tensor` of type `float32`.
    max_filter: A `Tensor` of type `float32`.
    min_freezed_output: A `Tensor` of type `float32`.
    max_freezed_output: A `Tensor` of type `float32`.
    strides: A list of `ints`.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.quint8`.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  r\  rf   r`   r   r  Nr  ^Expected list for 'strides' argument to 'quantized_conv2d_and_relu_and_requantize' Op, not %r.r   `Expected list for 'dilations' argument to 'quantized_conv2d_and_relu_and_requantize' Op, not %r.cExpected list for 'padding_list' argument to 'quantized_conv2d_and_relu_and_requantize' Op, not %r.r   r   r;  r<  r{  r|  r  r  rf   r`   r\  r   r  r    r^  r  ) r&   r   r'   r(   r   r)   *_QuantizedConv2DAndReluAndRequantizeOutputr+   r,   r-   r.   r/   r0   7quantized_conv2d_and_relu_and_requantize_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r   r   r;  r<  r{  r|  r  r  rf   r`   r\  r   r  r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                           rQ   (quantized_conv2d_and_relu_and_requantizer  h   sc   4 
			0h..0$#\\113T5&9j*6HJ)W7KNg ;@@Ign 
GdE]	+
	ACJ	KL L 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	ACL	MN N =FFbx  [1F)FL	L4-	0
	ACO	PQ Q COOB(##B7O,O'88-U69B9B:D:DBTBT7>7>8@9B<H48:!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4nll>*,F ::L-|VWN6<<WE'	.} && -
##At,,## 
D
Iz:
087i#$D	: :
 ## 
 A G PB    ?J (L3L>LK&KKKK8 8LLz+raw_ops.QuantizedConv2DAndReluAndRequantizec                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |	d      }	|
t        j                  }
t	        j                  |
d      }
|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| |||||||g}d
|d|d|
d|d|	d|d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr  rf   r`   r\  r   r  r   r  r  r^  r  s#   QuantizedConv2DAndReluAndRequantizer  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   r   r   r;  r<  r{  r|  r  r  rf   r`   r\  r   r  r    r!   ro   rc  r  rP   rO   rJ   s                        rQ   r  r     s<   	GdE]	+
	ACJ	KL L 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	ACL	MN N =FFbx  [1F)FL	L4-	0
	ACO	PQ Q COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&$$Y@)$$Y@)%%j'//B*%%j'//B*--.@'//R--.@'//RIz:Oacuv,lI}j
Iw	7K, & CQ$0C"&(' ""$-|VWN6<<WE'	.M A G P   L>4M?MQuantizedConv2DAndRequantize&TV_QuantizedConv2DAndRequantize_Tinput'TV_QuantizedConv2DAndRequantize_Tfilter(TV_QuantizedConv2DAndRequantize_out_typec                 B   t         j                   xs t        j                         }|j                  }|j                  rA	 t	        j
                  |d|| |||||||d|
d|d|	d|d|      }t        j                  |      }|S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |	d      }	|
t,        j.                  }
t'        j0                  |
d      }
|g d
}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  d| |||||||||	|
|||      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||
||	||||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )ao  TODO: add doc.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    min_input: A `Tensor` of type `float32`.
    max_input: A `Tensor` of type `float32`.
    min_filter: A `Tensor` of type `float32`.
    max_filter: A `Tensor` of type `float32`.
    min_freezed_output: A `Tensor` of type `float32`.
    max_freezed_output: A `Tensor` of type `float32`.
    strides: A list of `ints`.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint8`.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  r\  rf   r`   r   r  Nr  UExpected list for 'strides' argument to 'quantized_conv2d_and_requantize' Op, not %r.r   WExpected list for 'dilations' argument to 'quantized_conv2d_and_requantize' Op, not %r.ZExpected list for 'padding_list' argument to 'quantized_conv2d_and_requantize' Op, not %r.r  r^  r  ) r&   r   r'   r(   r   r)   #_QuantizedConv2DAndRequantizeOutputr+   r,   r-   r.   r/   r0   .quantized_conv2d_and_requantize_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r  s                           rQ   quantized_conv2d_and_requantizer  !  s_   4 
			0h..0$#\\11,dE69:z+=J)W7KNg 499'Bgn 
GdE]	+
	8:A	BC C 9@@"Xr9-@'@gy1'}}H*5(I	Ie}	-
	8:C	DE E =FFbx  [1F)FL	L4-	0
	8:F	GH H COOB(##B7O,O'88&eF2;2;3=3=;M;M07192;5AN!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4nll>*,F ::L&fgG/55g>'	.y && -
##At,,## 
;
Iz:
087i#$D	: :
 ## 
 A G Pr  z$raw_ops.QuantizedConv2DAndRequantizec                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |	d      }	|
t        j                  }
t	        j                  |
d      }
|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| |||||||g}d
|d|d|
d|d|	d|d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr  rf   r`   r\  r   r  r   r  r  r^  r  s   QuantizedConv2DAndRequantizer  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   r  s                        rQ   r  r  n!  s9   	GdE]	+
	8:A	BC C 9@@"Xr9-@'@gy1'}}H*5(I	Ie}	-
	8:C	DE E =FFbx  [1F)FL	L4-	0
	8:F	GH H COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&$$Y@)$$Y@)%%j'//B*%%j'//B*--.@'//R--.@'//RIz:Oacuv,lI}j
Iw	7K, & <a$0C"&(' ""$&fgG/55g>'	.M A G Pr  QuantizedConv2DPerChannel#TV_QuantizedConv2DPerChannel_Tinput$TV_QuantizedConv2DPerChannel_Tfilter%TV_QuantizedConv2DPerChannel_out_typec                 l   t         j                   xs t        j                         }|j                  }|j                  r=	 t	        j
                  |d|
| |||||d|d|d|d|	      }t        j                  |      }|S t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|t,        j.                  }t'        j0                  |d      }|	g d	}	t        |	t         t"        f      st%        d
|	z        |	D cg c]  }t'        j(                  |d       }	}t3        j4                  d| |||||||||	|
      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||
       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
|      S # t        j                  $ r Y ,w xY wc c}w c c}w )aO  Computes QuantizedConv2D per channel.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original input tensor.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original filter tensor.
    min_input: A `Tensor` of type `float32`.
      The minimum value of the input tensor
    max_input: A `Tensor` of type `float32`.
      The maximum value of the input tensor.
    min_filter: A `Tensor` of type `float32`.
      The minimum value of the filter tensor.
    max_filter: A `Tensor` of type `float32`.
      The maximum value of the filter tensor.
    strides: A list of `ints`. list of stride values.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
      The quantized type of output tensor that needs to be converted.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      list of dilation values.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  r\  rf   r`   r   Nr~  RExpected list for 'strides' argument to 'quantized_conv2d_per_channel' Op, not %r.r   TExpected list for 'dilations' argument to 'quantized_conv2d_per_channel' Op, not %r.r  r^  r  ) r&   r   r'   r(   r   r)    _QuantizedConv2DPerChannelOutputr+   r,   r-   r.   r/   r0   +quantized_conv2d_per_channel_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r  s                        rQ   quantized_conv2d_per_channelr  !  s   > 
			0h..0$#\\
11)4	:z:xG[)=g 166w?gn 
GdE]	+
	57>	?@ @ 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	57@	AB B =FFbx  [1F)F'88#5/8I0:0:G-4x/8tE!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4	6F
 ::L#\67D,227;'	.] && -
##At,,## 
8
Iz:WgDd4 4 ## 
 A Gr  z!raw_ops.QuantizedConv2DPerChannelc                 b   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|t        j                  }t	        j                  |d      }|	g d}	t        |	t        t        f      st        d|	z        |	D cg c]  }t	        j
                  |d       }	}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| |||||g}d|d	|d|d|d|d|	f}t	        j$                  d
d||||
      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w )Nr  rf   r`   r\  r   r  r   r^  r  s   QuantizedConv2DPerChannelr  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   r  s                     rQ   r  r   "  s   	GdE]	+
	57>	?@ @ 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	57@	AB B =FFbx  [1F)F#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&$$Y@)$$Y@)%%j'//B*%%j'//B*Iz:N,lI}j
Iw	7KL&91$0C"&(' ""$#\67D,227;'	.9 A Gr  QuantizedConv2DWithBias!TV_QuantizedConv2DWithBias_Tinput"TV_QuantizedConv2DWithBias_Tfilter#TV_QuantizedConv2DWithBias_out_typec                 <   t         j                   xs t        j                         }|j                  }|j                  r@	 t	        j
                  |d|| ||||||d|	d|d|d|
d|      }t        j                  |      }|S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|	t,        j.                  }	t'        j0                  |	d      }	|
g d
}
t        |
t         t"        f      st%        d|
z        |
D cg c]  }t'        j(                  |d       }
}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  d| |||||||||	|
||      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||	|||
|||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w ),  TODO: add doc.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    bias: A `Tensor` of type `float32`.
    min_input: A `Tensor` of type `float32`.
    max_input: A `Tensor` of type `float32`.
    min_filter: A `Tensor` of type `float32`.
    max_filter: A `Tensor` of type `float32`.
    strides: A list of `ints`.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  r\  rf   r`   r   r  Nr  PExpected list for 'strides' argument to 'quantized_conv2d_with_bias' Op, not %r.r   RExpected list for 'dilations' argument to 'quantized_conv2d_with_bias' Op, not %r.UExpected list for 'padding_list' argument to 'quantized_conv2d_with_bias' Op, not %r.r   r   r   r;  r<  r{  r|  rf   r`   r\  r   r  r    r^  r  ) r&   r   r'   r(   r   r)   _QuantizedConv2DWithBiasOutputr+   r,   r-   r.   r/   r0   )quantized_conv2d_with_bias_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r   r   r   r;  r<  r{  r|  rf   r`   r\  r   r  r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                          rQ   quantized_conv2d_with_biasr  ,"  sO   2 
			0h..0$#\\11'ufdI:z:xG[)^	g
 /44W=gn 
GdE]	+
	35<	=> > 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	35>	?@ @ =FFbx  [1F)FL	L4-	0
	35A	BC C COOB(##B7O,O'88!vD-6).8.8'+2X-60<4I!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4nll>*,F ::L!<B*009'	.o && -
##At,,## 
6
y)ZWgLtO O ## 
 A G PB    >J 'L2L=LK$J??KKK5 5LLzraw_ops.QuantizedConv2DWithBiasc                 P   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|	t        j                  }	t	        j                  |	d      }	|
g d}
t        |
t        t        f      st        d|
z        |
D cg c]  }t	        j
                  |d       }
}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| ||||||g}d
|d|d|	d|d|d|
d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr  rf   r`   r\  r   r  r   r  r  r^  r  s   QuantizedConv2DWithBiasr  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   r   r   r   r;  r<  r{  r|  rf   r`   r\  r   r  r    r!   ro   rc  r  rP   rO   rJ   s                       rQ   r  r  "  s   	GdE]	+
	35<	=> > 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	35>	?@ @ =FFbx  [1F)FL	L4-	0
	35A	BC C COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&			goo	6$$$Y@)$$Y@)%%j'//B*%%j'//B*y)ZT,lI}j
Iw	7K, & 7$0C"&(' ""$!<B*009'	.K A G P   L4L?L#QuantizedConv2DWithBiasAndRelu(TV_QuantizedConv2DWithBiasAndRelu_Tinput)TV_QuantizedConv2DWithBiasAndRelu_Tfilter*TV_QuantizedConv2DWithBiasAndRelu_out_typec                 <   t         j                   xs t        j                         }|j                  }|j                  r@	 t	        j
                  |d|| ||||||d|	d|d|d|
d|      }t        j                  |      }|S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|	t,        j.                  }	t'        j0                  |	d      }	|
g d
}
t        |
t         t"        f      st%        d|
z        |
D cg c]  }t'        j(                  |d       }
}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  d| |||||||||	|
||      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||	|||
|||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )r  r  r\  rf   r`   r   r  Nr  YExpected list for 'strides' argument to 'quantized_conv2d_with_bias_and_relu' Op, not %r.r   [Expected list for 'dilations' argument to 'quantized_conv2d_with_bias_and_relu' Op, not %r.^Expected list for 'padding_list' argument to 'quantized_conv2d_with_bias_and_relu' Op, not %r.r  r^  r  ) r&   r   r'   r(   r   r)   %_QuantizedConv2DWithBiasAndReluOutputr+   r,   r-   r.   r/   r0   2quantized_conv2d_with_bias_and_relu_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r  s                          rQ   #quantized_conv2d_with_bias_and_relur  "  sU   2 
			0h..0$#\\11.eVT9j*j(7IwY	&g
 6;;GDgn 
GdE]	+
	<>E	FG G 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	<>G	HI I =FFbx  [1F)FL	L4-	0
	<>J	KL L COOB(##B7O,O'88(f/3y4=5?5?2973;4=7C/3
5!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4nll>*,F ::L(,I177@'	.u && -
##At,,## 
?
y)ZWgLtO O ## 
 A G Pr  z&raw_ops.QuantizedConv2DWithBiasAndReluc                 P   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|	t        j                  }	t	        j                  |	d      }	|
g d}
t        |
t        t        f      st        d|
z        |
D cg c]  }t	        j
                  |d       }
}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| ||||||g}d
|d|d|	d|d|d|
d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr  rf   r`   r\  r   r  r   r  r  r^  r  s   QuantizedConv2DWithBiasAndRelur  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   r  s                       rQ   r  r  $#  s   	GdE]	+
	<>E	FG G 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	<>G	HI I =FFbx  [1F)FL	L4-	0
	<>J	KL L COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&			goo	6$$$Y@)$$Y@)%%j'//B*%%j'//B*y)ZT,lI}j
Iw	7K, & >$0C"&(' ""$(,I177@'	.K A G Pr  +QuantizedConv2DWithBiasAndReluAndRequantize5TV_QuantizedConv2DWithBiasAndReluAndRequantize_Tinput6TV_QuantizedConv2DWithBiasAndReluAndRequantize_Tfilter4TV_QuantizedConv2DWithBiasAndReluAndRequantize_Tbias7TV_QuantizedConv2DWithBiasAndReluAndRequantize_out_typec                 h   t         j                   xs t        j                         }|j                  }|j                  rB	 t	        j
                  |d|| ||||||||d|d|	d|
d|d|      }t        j                  |      }|S t        |	t         t"        f      st%        d	|	z        |	D cg c]  }t'        j(                  |d       }	}t'        j*                  |
d      }
|t,        j.                  }t'        j0                  |d      }|g d
}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  	 d| |||||||||	|
||||d\  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||||	|
||||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )a  TODO: add doc.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    bias: A `Tensor`. Must be one of the following types: `float32`, `qint32`.
    min_input: A `Tensor` of type `float32`.
    max_input: A `Tensor` of type `float32`.
    min_filter: A `Tensor` of type `float32`.
    max_filter: A `Tensor` of type `float32`.
    min_freezed_output: A `Tensor` of type `float32`.
    max_freezed_output: A `Tensor` of type `float32`.
    strides: A list of `ints`.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.quint8`.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  r\  rf   r`   r   r  Nr  hExpected list for 'strides' argument to 'quantized_conv2d_with_bias_and_relu_and_requantize' Op, not %r.r   jExpected list for 'dilations' argument to 'quantized_conv2d_with_bias_and_relu_and_requantize' Op, not %r.mExpected list for 'padding_list' argument to 'quantized_conv2d_with_bias_and_relu_and_requantize' Op, not %r.r   r   r   r;  r<  r{  r|  r  r  rf   r`   r\  r   r  r    r^  r  Tbias)r  ) r&   r   r'   r(   r   r)   2_QuantizedConv2DWithBiasAndReluAndRequantizeOutputr+   r,   r-   r.   r/   r0   Aquantized_conv2d_with_bias_and_relu_and_requantize_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r   r   r   r;  r<  r{  r|  r  r  rf   r`   r\  r   r  r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                            rQ   2quantized_conv2d_with_bias_and_relu_and_requantizer  Z#  s   6 
			0h..0$#\\11;T5iJ
.
H7IwY&g CHHQgn 
GdE]	+
	KMT	UV V 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	KMV	WX X =FFbx  [1F)FL	L4-	0
	KMY	Z[ [ COOB(##B7O,O'885B=B>D<@AJAJBLBLJ\J\?F?F@HAJDP<@B!QX  QK'""$**84i  +W  ):  ,ill9%y#,,y2I3<<4nll>*,F ::L5|VWV>DDWM'	.C && -
##At,,## 
N
y)Z
087i#$D	: :
 ## 
 A G PC    A J% )L%4L*?L/%K,8KK,+K,0L L"!L"z3raw_ops.QuantizedConv2DWithBiasAndReluAndRequantizec                    t        |	t        t        f      st        d|	z        |	D cg c]  }t	        j
                  |d       }	}t	        j                  |
d      }
|t        j                  }t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t	        j                  |g|t        j                  t        j                  g      \  }\  }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }| ||||||||g	}d
|d|d|d|d|	d|
d|d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr  rf   r`   r\  r   r  r   r  r  r^  r  r  s+   QuantizedConv2DWithBiasAndReluAndRequantizer  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   rZ   r.   r   r   rA   rG   r  r+   r   r   r   r;  r<  r{  r|  r  r  rf   r`   r\  r   r  r    r!   ro   rc  r  _attr_TbiasrP   rO   rJ   s                          rQ   r  r  #  so   	GdE]	+
	KMT	UV V 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	KMV	WX X =FFbx  [1F)FL	L4-	0
	KMY	Z[ [ COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&!88$wX_XfXfFij+w$$Y@)$$Y@)%%j'//B*%%j'//B*--.@'//R--.@'//Ry)ZUgi{|,lI}gz8YGy.,8& K|6s"&(' ""$5|VWV>DDWM'	.O A G P   M<4N?N$QuantizedConv2DWithBiasAndRequantize.TV_QuantizedConv2DWithBiasAndRequantize_Tinput/TV_QuantizedConv2DWithBiasAndRequantize_Tfilter-TV_QuantizedConv2DWithBiasAndRequantize_Tbias0TV_QuantizedConv2DWithBiasAndRequantize_out_typec                 h   t         j                   xs t        j                         }|j                  }|j                  rB	 t	        j
                  |d|| ||||||||d|d|	d|
d|d|      }t        j                  |      }|S t        |	t         t"        f      st%        d	|	z        |	D cg c]  }t'        j(                  |d       }	}t'        j*                  |
d      }
|t,        j.                  }t'        j0                  |d      }|g d
}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  	 d| |||||||||	|
||||d\  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||||	|
||||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )a  TODO: add doc.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    bias: A `Tensor`. Must be one of the following types: `float32`, `qint32`.
    min_input: A `Tensor` of type `float32`.
    max_input: A `Tensor` of type `float32`.
    min_filter: A `Tensor` of type `float32`.
    max_filter: A `Tensor` of type `float32`.
    min_freezed_output: A `Tensor` of type `float32`.
    max_freezed_output: A `Tensor` of type `float32`.
    strides: A list of `ints`.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint8`.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  r\  rf   r`   r   r  Nr  _Expected list for 'strides' argument to 'quantized_conv2d_with_bias_and_requantize' Op, not %r.r   aExpected list for 'dilations' argument to 'quantized_conv2d_with_bias_and_requantize' Op, not %r.dExpected list for 'padding_list' argument to 'quantized_conv2d_with_bias_and_requantize' Op, not %r.r  r^  r  r  )r  ) r&   r   r'   r(   r   r)   +_QuantizedConv2DWithBiasAndRequantizeOutputr+   r,   r-   r.   r/   r0   8quantized_conv2d_with_bias_and_requantize_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r  s                            rQ   )quantized_conv2d_with_bias_and_requantizer  #  s   6 
			0h..0$#\\114dE6iJ
.
H7IwY&g <AA'Jgn 
GdE]	+
	BDK	LM M 9@@"Xr9-@'@gy1'}}H*5(I	Ie}	-
	BDM	NO O =FFbx  [1F)FL	L4-	0
	BDP	QR R COOB(##B7O,O'88.;6;F59:C:C;E;ECUCU8?8?9A:C=I59;!QX QK'""$**84i  +W  ):  ,ill9%y#,,y2I3<<4nll>*,F ::L.fgO7==gF'	.A && -
##At,,## 
E
y)Z
087i#$D	: :
 ## 
 A G Pr  z,raw_ops.QuantizedConv2DWithBiasAndRequantizec                    t        |	t        t        f      st        d|	z        |	D cg c]  }t	        j
                  |d       }	}t	        j                  |
d      }
|t        j                  }t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t	        j                  |g|t        j                  t        j                  g      \  }\  }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }| ||||||||g	}d
|d|d|d|d|	d|
d|d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr  rf   r`   r\  r   r  r   r  r  r^  r  r  s$   QuantizedConv2DWithBiasAndRequantizer  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   rZ   r.   r   r   rA   rG   r  r+   r  s                          rQ   r   r   k$  so   	GdE]	+
	BDK	LM M 9@@"Xr9-@'@gy1'}}H*5(I	Ie}	-
	BDM	NO O =FFbx  [1F)FL	L4-	0
	BDP	QR R COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&!88$wX_XfXfFij+w$$Y@)$$Y@)%%j'//B*%%j'//B*--.@'//R--.@'//Ry)ZUgi{|,lI}gz8YGy.,8& Da$0C"&(' ""$.fgO7==gF'	.O A G Pr  4QuantizedConv2DWithBiasSignedSumAndReluAndRequantize>TV_QuantizedConv2DWithBiasSignedSumAndReluAndRequantize_Tinput?TV_QuantizedConv2DWithBiasSignedSumAndReluAndRequantize_Tfilter=TV_QuantizedConv2DWithBiasSignedSumAndReluAndRequantize_Tbias@TV_QuantizedConv2DWithBiasSignedSumAndReluAndRequantize_Tsummand@TV_QuantizedConv2DWithBiasSignedSumAndReluAndRequantize_out_typesummandmin_summandmax_summandc                    t         j                   xs t        j                         }|j                  }|j                  rE	 t	        j
                  |d|| |||||||||	|
|d|d|d|d|d|      }t        j                  |      }|S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|t,        j.                  }t'        j0                  |d      }|g d
}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  	 di d| d|d|d|d|d|d|d|d|d|	d|
d|d|d|d|d|d|d|\  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
||||||||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )  TODO: add doc.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    bias: A `Tensor`. Must be one of the following types: `float32`, `qint32`.
    min_input: A `Tensor` of type `float32`.
    max_input: A `Tensor` of type `float32`.
    min_filter: A `Tensor` of type `float32`.
    max_filter: A `Tensor` of type `float32`.
    min_freezed_output: A `Tensor` of type `float32`.
    max_freezed_output: A `Tensor` of type `float32`.
    summand: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    min_summand: A `Tensor` of type `float32`.
    max_summand: A `Tensor` of type `float32`.
    strides: A list of `ints`.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.quint8`.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  r\  rf   r`   r   r  Nr  sExpected list for 'strides' argument to 'quantized_conv2d_with_bias_signed_sum_and_relu_and_requantize' Op, not %r.r   uExpected list for 'dilations' argument to 'quantized_conv2d_with_bias_signed_sum_and_relu_and_requantize' Op, not %r.xExpected list for 'padding_list' argument to 'quantized_conv2d_with_bias_signed_sum_and_relu_and_requantize' Op, not %r.r   r   r   r;  r<  r{  r|  r  r  r	  r
  r  r    r^  r  r  Tsummand)r  ) r&   r   r'   r(   r   r)   ;_QuantizedConv2DWithBiasSignedSumAndReluAndRequantizeOutputr+   r,   r-   r.   r/   r0   Lquantized_conv2d_with_bias_signed_sum_and_relu_and_requantize_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r   r   r   r;  r<  r{  r|  r  r  r	  r
  r  rf   r`   r\  r   r  r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                               rQ   =quantized_conv2d_with_bias_signed_sum_and_relu_and_requantizer  $  sT   < 
			0h..0$#\\11DdvtY	:z.Z9gyiGg LQQRYZgn 
GdE]	+
	VX_	`a a 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	VXa	bc c =FFbx  [1F)FL	L4-	0
	VXd	ef f COOB(##B7O,O'88>KFKKGMK FJK KT	K
 KTK LVK LVK TfK TfK IPK MXK MXK IPK IPK JRK  KT!K" NZ#K$ FJ%K!QX& QK'""$**84i  +W  ):  ,j  ,ill9%y#,,y2I3<<4nll>*,F ::L>fV]_GMMgV'	.K && -
##At,,## 
Y
y)Z
0';
'7Lt	O O
 ## 
 A G PC    AK ,M"7M'M,L&2LL&%L&*M MMz<raw_ops.QuantizedConv2DWithBiasSignedSumAndReluAndRequantizec                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|t        j                  }t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t	        j                  |g|t        j                  t        j                  g      \  }\  }t	        j                  |	g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }	t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |
t        j                        }
t!        j"                  |t        j                        }| |||||||||	|
|g}d
|d|d|d|d|d|d|d|d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr  rf   r`   r\  r   r  r   r  r  r^  r  r  r  s4   QuantizedConv2DWithBiasSignedSumAndReluAndRequantizer  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   rZ   r.   r   r   rA   rG   r  r+   r   r   r   r;  r<  r{  r|  r  r  r	  r
  r  rf   r`   r\  r   r  r    r!   ro   rc  r  r  _attr_TsummandrP   rO   rJ   s                              rQ   r  r  %  s#   	GdE]	+
	VX_	`a a 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	VXa	bc c =FFbx  [1F)FL	L4-	0
	VXd	ef f COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&!88$wX_XfXfFij+w'>>y#PWP]P]_f_m_movo}o}  @G  @N  @N  PW  P_  P_  Pb   c.*7$$Y@)$$Y@)%%j'//B*%%j'//B*--.@'//R--.@'//R&&{GOOD+&&{GOOD+y)ZUgi{  ~E  GR  T_  `,lI}gz>:x	9g{I~& T|6s"&(' ""$>fV]_GMMgV'	.W A G P   P14P6?P;!QuantizedConv2DWithBiasSumAndRelu+TV_QuantizedConv2DWithBiasSumAndRelu_Tinput,TV_QuantizedConv2DWithBiasSumAndRelu_Tfilter-TV_QuantizedConv2DWithBiasSumAndRelu_out_typec                 B   t         j                   xs t        j                         }|j                  }|j                  rA	 t	        j
                  |d|| |||||||d|
d|d|	d|d|      }t        j                  |      }|S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |	d      }	|
t,        j.                  }
t'        j0                  |
d      }
|g d
}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  d| |||||||||	|
|||      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||
||	||||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )aW  TODO: add doc.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    bias: A `Tensor` of type `float32`.
    min_input: A `Tensor` of type `float32`.
    max_input: A `Tensor` of type `float32`.
    min_filter: A `Tensor` of type `float32`.
    max_filter: A `Tensor` of type `float32`.
    summand: A `Tensor` of type `float32`.
    strides: A list of `ints`.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  r\  rf   r`   r   r  Nr  ]Expected list for 'strides' argument to 'quantized_conv2d_with_bias_sum_and_relu' Op, not %r.r   _Expected list for 'dilations' argument to 'quantized_conv2d_with_bias_sum_and_relu' Op, not %r.bExpected list for 'padding_list' argument to 'quantized_conv2d_with_bias_sum_and_relu' Op, not %r.)r   r   r   r;  r<  r{  r|  r	  rf   r`   r\  r   r  r    r^  r  ) r&   r   r'   r(   r   r)   (_QuantizedConv2DWithBiasSumAndReluOutputr+   r,   r-   r.   r/   r0   6quantized_conv2d_with_bias_sum_and_relu_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   )r   r   r   r;  r<  r{  r|  r	  rf   r`   r\  r   r  r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                           rQ   'quantized_conv2d_with_bias_sum_and_relur%  S%  s_   4 
			0h..0$#\\11149j*gz)Wi+><	1g
 9>>wGgn 
GdE]	+
	@BI	JK K 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	@BK	LM M =FFbx  [1F)FL	L4-	0
	@BN	OP P COOB(##B7O,O'88+526)7@8B8B5<g5<6>7@:F268!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4nll>*,F ::L+\67L4::7C'	.w && -
##At,,## 
C
y)Z
HgwLtO O ## 
 A G Pr  z)raw_ops.QuantizedConv2DWithBiasSumAndReluc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |	d      }	|
t        j                  }
t	        j                  |
d      }
|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| |||||||g}d
|d|d|
d|d|	d|d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr   rf   r`   r\  r   r!  r   r"  r  r^  r  s!   QuantizedConv2DWithBiasSumAndRelur  rT   r  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r#  r+   )r   r   r   r;  r<  r{  r|  r	  rf   r`   r\  r   r  r    r!   ro   rc  r  rP   rO   rJ   s                        rQ   r$  r$  %  s7   	GdE]	+
	@BI	JK K 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	@BK	LM M =FFbx  [1F)FL	L4-	0
	@BN	OP P COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&			goo	6$$$Y@)$$Y@)%%j'//B*%%j'//B*""7GOO<'y)ZU\],lI}j
Iw	7K, & A1$0C"&(' ""$+\67L4::7C'	.M A G Pr  .QuantizedConv2DWithBiasSumAndReluAndRequantize8TV_QuantizedConv2DWithBiasSumAndReluAndRequantize_Tinput9TV_QuantizedConv2DWithBiasSumAndReluAndRequantize_Tfilter7TV_QuantizedConv2DWithBiasSumAndReluAndRequantize_Tbias:TV_QuantizedConv2DWithBiasSumAndReluAndRequantize_Tsummand:TV_QuantizedConv2DWithBiasSumAndReluAndRequantize_out_typec                    t         j                   xs t        j                         }|j                  }|j                  rE	 t	        j
                  |d|| |||||||||	|
|d|d|d|d|d|      }t        j                  |      }|S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|t,        j.                  }t'        j0                  |d      }|g d
}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  	 di d| d|d|d|d|d|d|d|d|d|	d|
d|d|d|d|d|d|d|\  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
||||||||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )r  r'  r\  rf   r`   r   r  Nr  lExpected list for 'strides' argument to 'quantized_conv2d_with_bias_sum_and_relu_and_requantize' Op, not %r.r   nExpected list for 'dilations' argument to 'quantized_conv2d_with_bias_sum_and_relu_and_requantize' Op, not %r.qExpected list for 'padding_list' argument to 'quantized_conv2d_with_bias_sum_and_relu_and_requantize' Op, not %r.r   r   r   r;  r<  r{  r|  r  r  r	  r
  r  r    r^  r  r  r  )r'  ) r&   r   r'   r(   r   r)   5_QuantizedConv2DWithBiasSumAndReluAndRequantizeOutputr+   r,   r-   r.   r/   r0   Equantized_conv2d_with_bias_sum_and_relu_and_requantize_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r  s                               rQ   6quantized_conv2d_with_bias_sum_and_relu_and_requantizer3  %  sS   < 
			0h..0$#\\11>eiJ
.Z9gyiGg FKKGTgn 
GdE]	+
	OQX	YZ Z 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	OQZ	[\ \ =FFbx  [1F)FL	L4-	0
	OQ]	^_ _ COOB(##B7O,O'888E@EEAGE @DE EN	E
 ENE FPE FPE N`E N`E CJE GRE GRE CJE CJE DLE  EN!E" HT#E$ @D%E!QX& QK'""$**84i  +W  ):  ,j  ,ill9%y#,,y2I3<<4nll>*,F ::L8,PWYAGGP'	.K && -
##At,,## 
R
y)Z
0';
'7Lt	O O
 ## 
 A G Pr  z6raw_ops.QuantizedConv2DWithBiasSumAndReluAndRequantizec                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|t        j                  }t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t	        j                  |g|t        j                  t        j                  g      \  }\  }t	        j                  |	g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }	t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |
t        j                        }
t!        j"                  |t        j                        }| |||||||||	|
|g}d
|d|d|d|d|d|d|d|d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr.  rf   r`   r\  r   r/  r   r0  r  r^  r  r  r  s.   QuantizedConv2DWithBiasSumAndReluAndRequantizer  rT   r'  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   rZ   r.   r   r   rA   rG   r1  r+   r  s                              rQ   r2  r2  d&  s#   	GdE]	+
	OQX	YZ Z 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	OQZ	[\ \ =FFbx  [1F)FL	L4-	0
	OQ]	^_ _ COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&!88$wX_XfXfFij+w'>>y#PWP]P]_f_m_movo}o}  @G  @N  @N  PW  P_  P_  Pb   c.*7$$Y@)$$Y@)%%j'//B*%%j'//B*--.@'//R--.@'//R&&{GOOD+&&{GOOD+y)ZUgi{  ~E  GR  T_  `,lI}gz>:x	9g{I~& N|6s"&(' ""$8,PWYAGGP'	.W A G Pr  QuantizedDepthwiseConv2D"TV_QuantizedDepthwiseConv2D_Tinput#TV_QuantizedDepthwiseConv2D_Tfilter$TV_QuantizedDepthwiseConv2D_out_typec                 l   t         j                   xs t        j                         }|j                  }|j                  r=	 t	        j
                  |d|
| |||||d|d|d|d|	      }t        j                  |      }|S t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|t,        j.                  }t'        j0                  |d      }|	g d	}	t        |	t         t"        f      st%        d
|	z        |	D cg c]  }t'        j(                  |d       }	}t3        j4                  d| |||||||||	|
      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||
       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
|      S # t        j                  $ r Y ,w xY wc c}w c c}w )a  Computes quantized depthwise Conv2D.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original input tensor.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original filter tensor.
    min_input: A `Tensor` of type `float32`.
      The float value that the minimum quantized input value represents.
    max_input: A `Tensor` of type `float32`.
      The float value that the maximum quantized input value represents.
    min_filter: A `Tensor` of type `float32`.
      The float value that the minimum quantized filter value represents.
    max_filter: A `Tensor` of type `float32`.
      The float value that the maximum quantized filter value represents.
    strides: A list of `ints`. List of stride values.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
      The type of the output.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      List of dilation values.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r5  r\  rf   r`   r   Nr~  PExpected list for 'strides' argument to 'quantized_depthwise_conv2d' Op, not %r.r   RExpected list for 'dilations' argument to 'quantized_depthwise_conv2d' Op, not %r.r  r^  r  ) r&   r   r'   r(   r   r)   _QuantizedDepthwiseConv2DOutputr+   r,   r-   r.   r/   r0   )quantized_depthwise_conv2d_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r  s                        rQ   quantized_depthwise_conv2dr>  &  s   > 
			0h..0$#\\
11($vy:z:xG[)=g 055g>gn 
GdE]	+
	35<	=> > 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	35>	?@ @ =FFbx  [1F)F'88"%.79/9/97,3h.7dD!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4	6F
 ::L"L&'C+11':'	.] && -
##At,,## 
6
Iz:WgDd4 4 ## 
 A Gr  z raw_ops.QuantizedDepthwiseConv2Dc                 b   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|t        j                  }t	        j                  |d      }|	g d}	t        |	t        t        f      st        d|	z        |	D cg c]  }t	        j
                  |d       }	}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| |||||g}d|d	|d|d|d|d|	f}t	        j$                  d
d||||
      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w )Nr:  rf   r`   r\  r   r;  r   r^  r  s   QuantizedDepthwiseConv2Dr  rT   r5  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r<  r+   r  s                     rQ   r=  r=  &  s   	GdE]	+
	35<	=> > 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	35>	?@ @ =FFbx  [1F)F#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&$$Y@)$$Y@)%%j'//B*%%j'//B*Iz:N,lI}j
Iw	7KL&8!$0C"&(' ""$"L&'C+11':'	.9 A Gr   QuantizedDepthwiseConv2DWithBias*TV_QuantizedDepthwiseConv2DWithBias_Tinput+TV_QuantizedDepthwiseConv2DWithBias_Tfilter,TV_QuantizedDepthwiseConv2DWithBias_out_typec                 r   t         j                   xs t        j                         }|j                  }|j                  r>	 t	        j
                  |d|| ||||||d|	d|d|d|
      }t        j                  |      }|S t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|	t,        j.                  }	t'        j0                  |	d      }	|
g d	}
t        |
t         t"        f      st%        d
|
z        |
D cg c]  }t'        j(                  |d       }
}t3        j4                  d| |||||||||	|
|      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||	|||
||      S # t        j                  $ r Y .w xY wc c}w c c}w )a  Computes quantized depthwise Conv2D with Bias.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original input tensor.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original filter tensor.
    bias: A `Tensor` of type `float32`. The original bias tensor.
    min_input: A `Tensor` of type `float32`.
      The float value that the minimum quantized input value represents.
    max_input: A `Tensor` of type `float32`.
      The float value that the maximum quantized input value represents.
    min_filter: A `Tensor` of type `float32`.
      The float value that the minimum quantized filter value represents.
    max_filter: A `Tensor` of type `float32`.
      The float value that the maximum quantized filter value represents.
    strides: A list of `ints`. List of stride values.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
      The type of the output.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      List of dilation values.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r@  r\  rf   r`   r   Nr~  ZExpected list for 'strides' argument to 'quantized_depthwise_conv2d_with_bias' Op, not %r.r   \Expected list for 'dilations' argument to 'quantized_depthwise_conv2d_with_bias' Op, not %r.)r   r   r   r;  r<  r{  r|  rf   r`   r\  r   r    r^  r  ) r&   r   r'   r(   r   r)   '_QuantizedDepthwiseConv2DWithBiasOutputr+   r,   r-   r.   r/   r0   3quantized_depthwise_conv2d_with_bias_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   )r   r   r   r;  r<  r{  r|  rf   r`   r\  r   r    rH   rI   rJ   rK   ro   rL   rM   rN   rO   rP   s                         rQ   $quantized_depthwise_conv2d_with_biasrI  ''  s   @ 
			0h..0$#\\
110$vt9j*j(7IwYHg 8==gFgn 
GdE]	+
	=?F	GH H 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	=?H	IJ J =FFbx  [1F)F'88*%156?7A7A4;W5=6?dL!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4	6F
 ::L*L&'K399'B'	.a && -
##At,,## 
@
y)ZWgDd4 4 ## 
 A Gs<    <H2 %J/0J42I9I  I98I9=J J,+J,z(raw_ops.QuantizedDepthwiseConv2DWithBiasc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|	t        j                  }	t	        j                  |	d      }	|
g d}
t        |
t        t        f      st        d|
z        |
D cg c]  }t	        j
                  |d       }
}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| ||||||g}d|d	|d|	d|d|d|
f}t	        j$                  d
d||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w )NrE  rf   r`   r\  r   rF  r   r^  r  s    QuantizedDepthwiseConv2DWithBiasr  rT   r@  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   rG  r+   )r   r   r   r;  r<  r{  r|  rf   r`   r\  r   r    r!   ro   rc  r  rP   rO   rJ   s                      rQ   rH  rH  '  s   	GdE]	+
	=?F	GH H 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	=?H	IJ J =FFbx  [1F)F#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&			goo	6$$$Y@)$$Y@)%%j'//B*%%j'//B*y)ZT,lI}j
Iw	7KL&@!$0C"&(' ""$*L&'K399'B'	.; A Gs   K4K'QuantizedDepthwiseConv2DWithBiasAndRelu1TV_QuantizedDepthwiseConv2DWithBiasAndRelu_Tinput2TV_QuantizedDepthwiseConv2DWithBiasAndRelu_Tfilter3TV_QuantizedDepthwiseConv2DWithBiasAndRelu_out_typec                 <   t         j                   xs t        j                         }|j                  }|j                  r@	 t	        j
                  |d|| ||||||d|	d|d|d|
d|      }t        j                  |      }|S t        |t         t"        f      st%        d	|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }|	t,        j.                  }	t'        j0                  |	d      }	|
g d
}
t        |
t         t"        f      st%        d|
z        |
D cg c]  }t'        j(                  |d       }
}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  d| |||||||||	|
||      \  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||	|||
|||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )a,  Computes quantized depthwise Conv2D with Bias and Relu.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original input tensor.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original filter tensor.
    bias: A `Tensor` of type `float32`. The original bias tensor.
    min_input: A `Tensor` of type `float32`.
      The float value that the minimum quantized input value represents.
    max_input: A `Tensor` of type `float32`.
      The float value that the maximum quantized input value represents.
    min_filter: A `Tensor` of type `float32`.
      The float value that the minimum quantized filter value represents.
    max_filter: A `Tensor` of type `float32`.
      The float value that the maximum quantized filter value represents.
    strides: A list of `ints`. List of stride values.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
      The type of the output.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      List of dilation values.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  rK  r\  rf   r`   r   r  Nr  cExpected list for 'strides' argument to 'quantized_depthwise_conv2d_with_bias_and_relu' Op, not %r.r   eExpected list for 'dilations' argument to 'quantized_depthwise_conv2d_with_bias_and_relu' Op, not %r.hExpected list for 'padding_list' argument to 'quantized_depthwise_conv2d_with_bias_and_relu' Op, not %r.r  r^  r  ) r&   r   r'   r(   r   r)   ._QuantizedDepthwiseConv2DWithBiasAndReluOutputr+   r,   r-   r.   r/   r0   <quantized_depthwise_conv2d_with_bias_and_relu_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r  s                          rQ   -quantized_depthwise_conv2d_with_bias_and_relurU  '  s[   B 
			0h..0$#\\117ufiJ
J)Wi+><	1g
 ?DDWMgn 
GdE]	+
	FHO	PQ Q 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	FHQ	RS S =FFbx  [1F)FL	L4-	0
	FHT	UV V COOB(##B7O,O'881v8<=F=F>H>H;B;B<D=F@L8<>!QX QK'""$**84i  +Z  ,ill9%y#,,y2I3<<4nll>*,F ::L1<R:@@I'	.y && -
##At,,## 
I
y)ZWgLtO O ## 
 A G Pr  z/raw_ops.QuantizedDepthwiseConv2DWithBiasAndReluc                 P   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }|	t        j                  }	t	        j                  |	d      }	|
g d}
t        |
t        t        f      st        d|
z        |
D cg c]  }t	        j
                  |d       }
}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }t        j                   |t        j"                        }| ||||||g}d
|d|d|	d|d|d|
d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )NrP  rf   r`   r\  r   rQ  r   rR  r  r^  r  s'   QuantizedDepthwiseConv2DWithBiasAndRelur  rT   rK  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   rS  r+   r  s                       rQ   rT  rT   (  s   	GdE]	+
	FHO	PQ Q 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	FHQ	RS S =FFbx  [1F)FL	L4-	0
	FHT	UV V COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&			goo	6$$$Y@)$$Y@)%%j'//B*%%j'//B*y)ZT,lI}j
Iw	7K, & G$0C"&(' ""$1<R:@@I'	.K A G Pr  4QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize>TV_QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize_Tinput?TV_QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize_Tfilter=TV_QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize_Tbias@TV_QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize_out_typec                 h   t         j                   xs t        j                         }|j                  }|j                  rB	 t	        j
                  |d|| ||||||||d|d|	d|
d|d|      }t        j                  |      }|S t        |	t         t"        f      st%        d	|	z        |	D cg c]  }t'        j(                  |d       }	}t'        j*                  |
d      }
|t,        j.                  }t'        j0                  |d      }|g d
}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t3        j4                  	 d| |||||||||	|
||||d\  }}}}|dd }t'        j6                         rd|j9                  d      d|j9                  d      d|j9                  d      d|j9                  d      d|j;                  d      d|j;                  d      d|j;                  d      d|j;                  d      f}|j<                  }t'        j>                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||||	|
||||      S # t        j                  $ r Y w xY wc c}w c c}w c c}w )a9  Computes quantized depthwise Conv2D with Bias, Relu and Requantize.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original input tensor.
    filter: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The original filter tensor.
    bias: A `Tensor`. Must be one of the following types: `float32`, `qint32`.
      The original bias tensor.
    min_input: A `Tensor` of type `float32`.
      The float value that the minimum quantized input value represents.
    max_input: A `Tensor` of type `float32`.
      The float value that the maximum quantized input value represents.
    min_filter: A `Tensor` of type `float32`.
      The float value that the minimum quantized filter value represents.
    max_filter: A `Tensor` of type `float32`.
      The float value that the maximum quantized filter value represents.
    min_freezed_output: A `Tensor` of type `float32`.
      The minimum float value of the output tensor.
    max_freezed_output: A `Tensor` of type `float32`.
      The maximum float value of the output tensor.
    strides: A list of `ints`. List of stride values.
    padding: A `string` from: `"SAME", "VALID"`.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.quint8`.
      The type of the output.
    dilations: An optional list of `ints`. Defaults to `[1, 1, 1, 1]`.
      List of dilation values.
    padding_list: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor` of type `out_type`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  rW  r\  rf   r`   r   r  Nr  rExpected list for 'strides' argument to 'quantized_depthwise_conv2d_with_bias_and_relu_and_requantize' Op, not %r.r   tExpected list for 'dilations' argument to 'quantized_depthwise_conv2d_with_bias_and_relu_and_requantize' Op, not %r.wExpected list for 'padding_list' argument to 'quantized_depthwise_conv2d_with_bias_and_relu_and_requantize' Op, not %r.r  r^  r  r  )rW  ) r&   r   r'   r(   r   r)   ;_QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeOutputr+   r,   r-   r.   r/   r0   Kquantized_depthwise_conv2d_with_bias_and_relu_and_requantize_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   rW   r   r{  r?   r@   rA   rE   rC   rF   rG   r  s                            rQ   <quantized_depthwise_conv2d_with_bias_and_relu_and_requantizerb  V(  s   L 
			0h..0$#\\11DdvtY	:z.
H7IwY&g LQQRYZgn 
GdE]	+
	UW^	_` ` 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	UW`	ab b =FFbx  [1F)FL	L4-	0
	UWc	de e COOB(##B7O,O'88>KFKGMEIJSJSKUKUSeSeHOHOIQJSMYEIK!QX  QK'""$**84i  +W  ):  ,ill9%y#,,y2I3<<4nll>*,F ::L>fV]_GMMgV'	.C && -
##At,,## 
X
y)Z
087i#$D	: :
 ## 
 A G Pr  z<raw_ops.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizec                    t        |	t        t        f      st        d|	z        |	D cg c]  }t	        j
                  |d       }	}t	        j                  |
d      }
|t        j                  }t	        j                  |d      }|g d}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d	       }}t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } t	        j                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  }t	        j                  |g|t        j                  t        j                  g      \  }\  }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }t!        j"                  |t        j                        }| ||||||||g	}d
|d|d|d|d|	d|
d|d	|f}t	        j$                  dd||||      }t	        j&                         rt	        j(                  d|||       t*        j-                  |      }|S c c}w c c}w c c}w )Nr]  rf   r`   r\  r   r^  r   r_  r  r^  r  r  s4   QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizer  rT   rW  )rk   rl   rm   r5   r;   r<   rn   rW   r   r{  rV   r   r   r   r   rZ   r.   r   r   rA   rG   r`  r+   r  s                          rQ   ra  ra  (  sp   	GdE]	+
	UW^	_` ` 9@@"Xr9-@'@gy1'~~H*5(I	Ie}	-
	UW`	ab b =FFbx  [1F)FL	L4-	0
	UWc	de e COOB(##B7O,O#::E7C'--Y`YgYgipiwiw  zA  zH  zH  JQ  JY  JY  J\  ],%<<fXsW]]\c\j\jlslzlz  }D  }K  }K  MT  M\  M\  M_  `-&!88$wX_XfXfFij+w$$Y@)$$Y@)%%j'//B*%%j'//B*--.@'//R--.@'//Ry)ZUgi{|,lI}gz8YGy.,8& T|6s"&(' ""$>fV]_GMMgV'	.O A G Pr  QuantizedMatMulWithBias)outrf  rg  TV_QuantizedMatMulWithBias_T1TV_QuantizedMatMulWithBias_T2 TV_QuantizedMatMulWithBias_Tbias"TV_QuantizedMatMulWithBias_Toutput	MIN_FIRSTabmin_amax_amin_bmax_bToutputtranspose_atranspose_binput_quant_modec                    t         j                   xs t        j                         }|j                  }|j                  r>	 t	        j
                  |d|| ||||||d|d|d|	d|
      }t        j                  |      }|S |t        j                   }t#        j$                  |d      }|d}t#        j&                  |d      }|	d}	t#        j&                  |	d      }	|
d	}
t#        j(                  |
d      }
t+        j,                  d| |||||||||	|
|
      \  }}}}|dd }t#        j.                         rd|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j3                  d      d|j3                  d      d|j5                  d      f}|j6                  }t#        j8                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
||      S # t        j                  $ r Y w xY w)a  Performs a quantized matrix multiplication of `a` by the matrix `b` with bias
add.

  The inputs must be two-dimensional matrices and 1D bias vector. And the inner
  dimension of `a` (after being transposed if `transpose_a` is non-zero) must
  match the outer dimension of `b` (after being transposed if `transposed_b` is
  non-zero). Then do broadcast add operation with bias values on the matrix
  multiplication result. The bias size must match inner dimension of `b`.

  Args:
    a: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      A matrix to be multiplied. Must be a two-dimensional tensor of type `quint8`.
    b: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      A matrix to be multiplied and must be a two-dimensional tensor of type `qint8`.
    bias: A `Tensor`. Must be one of the following types: `float32`, `qint32`.
      A 1D bias tensor with size matching inner dimension of `b` (after being
      transposed if `transposed_b` is non-zero).
    min_a: A `Tensor` of type `float32`.
      The float value that the lowest quantized `a` value represents.
    max_a: A `Tensor` of type `float32`.
      The float value that the highest quantized `a` value represents.
    min_b: A `Tensor` of type `float32`.
      The float value that the lowest quantized `b` value represents.
    max_b: A `Tensor` of type `float32`.
      The float value that the highest quantized `b` value represents.
    Toutput: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
    transpose_a: An optional `bool`. Defaults to `False`.
      If true, `a` is transposed before multiplication.
    transpose_b: An optional `bool`. Defaults to `False`.
      If true, `b` is transposed before multiplication.
    input_quant_mode: An optional `string` from: `"MIN_FIRST", "SCALED"`. Defaults to `"MIN_FIRST"`.
      Input data quantization mode. Either MIN_FIRST(default) or SCALED.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (out, min_out, max_out).

    out: A `Tensor` of type `Toutput`.
    min_out: A `Tensor` of type `float32`.
    max_out: A `Tensor` of type `float32`.
  rd  rq  rr  rs  rt  Nrq  rr  rs  rt  r    r!   Frj  rk  rl  r   rm  rn  ro  rp  rq  rr  rs  rt  r    ro  rp  r  )r&   r   r'   r(   r   r)   _QuantizedMatMulWithBiasOutputr+   r,   r-   r.   r/   r0   *quantized_mat_mul_with_bias_eager_fallbackr4   rW   r   r;   r{  r>   rn   r?   r@   rA   rE   rD   rC   rF   rG   rk  rl  r   rm  rn  ro  rp  rq  rr  rs  rt  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                        rQ   quantized_mat_mul_with_biasr{  )  s   T 
			0h..0$#\\
11'q!T5%ui-{$68HJg /44W=gn _nnGw	2'K"";>+K"";>+"&&'79KL'88!Q!$e).e5+2/:4D(,.!QX QK'""$C&&t,dC4F4Ft4Ls))'2I  +]  /  /1Cll-.0F ::L!<B*009'	.W && -
##At,,## 
7
QeUE5'!{+$DB B ## 
s0    <G' 'H.:HH.-H.2I
 
I! I!zraw_ops.QuantizedMatMulWithBiasc                    |t         j                  }t        j                  |d      }|d}t        j                  |d      }|	d}	t        j                  |	d      }	|
d}
t        j
                  |
d      }
t        j                  | g|t         j                  t         j                  t         j                  t         j                  t         j                  g      \  }\  } t        j                  |g|t         j                  t         j                  t         j                  t         j                  t         j                  g      \  }\  }t        j                  |g|t         j                  t         j                  g      \  }\  }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }| ||||||g}d|d|d	|d|d|d|	d|
f}t        j                  d
d||||      }t        j                         rt        j                   d|||       t"        j%                  |      }|S )Nrq  Frr  rs  rj  rt  ro  rp  r  s   QuantizedMatMulWithBiasr  rT   rd  )rW   r   r;   r{  r>   rn   rV   r   r   r   r   rZ   r.   r   r   rA   rG   rx  r+   )rk  rl  r   rm  rn  ro  rp  rq  rr  rs  rt  r    r!   ru  rv  r  rP   rO   rJ   s                      rQ   ry  ry  j)  sE   _nnGw	2'K"";>+K"";>+"&&'79KL22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ!88$wX_XfXfFij+w

 
 
8%

 
 
8%

 
 
8%

 
 
8%QeUE59,(D(G[)	=+}k&(& 7$0C"&(' ""$!<B*009'	.r\   *TV_QuantizedMatMulWithBiasAndDequantize_T1*TV_QuantizedMatMulWithBiasAndDequantize_T2-TV_QuantizedMatMulWithBiasAndDequantize_Tbias/TV_QuantizedMatMulWithBiasAndDequantize_Toutputc                 d   t         j                   xs t        j                         }|j                  }|j                  r+	 t	        j
                  |d|| ||||||||d|	d|
d|d|      }|S t        j                  |	d      }	|
d}
t        j                  |
d      }
|d}t        j                  |d      }|d	}t        j                   |d      }t#        j$                  d| |||||||||	|
|||
      \  }}}}|dd }t        j&                         rd|j)                  d      d|j)                  d      d|j)                  d      d|j)                  d      d|j+                  d      d|j+                  d      d|j-                  d      f}|j.                  }t        j0                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
||||      S # t        j                  $ r Y w xY w)a  TODO: add doc.

  Args:
    a: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    b: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    bias: A `Tensor`. Must be one of the following types: `float32`, `qint32`.
    min_a: A `Tensor` of type `float32`.
    max_a: A `Tensor` of type `float32`.
    min_b: A `Tensor` of type `float32`.
    max_b: A `Tensor` of type `float32`.
    min_freezed_output: A `Tensor` of type `float32`.
    max_freezed_output: A `Tensor` of type `float32`.
    Toutput: A `tf.DType` from: `tf.float32`.
    transpose_a: An optional `bool`. Defaults to `False`.
    transpose_b: An optional `bool`. Defaults to `False`.
    input_quant_mode: An optional `string` from: `"MIN_FIRST", "SCALED"`. Defaults to `"MIN_FIRST"`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `Toutput`.
  $QuantizedMatMulWithBiasAndDequantizerq  rr  rs  rt  Nrv  Frj  rk  rl  r   rm  rn  ro  rp  r  r  rq  rr  rs  rt  r    ro  rp  r  )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   9quantized_mat_mul_with_bias_and_dequantize_eager_fallbackr4   r;   r{  r>   rn   r?   r@   rA   rE   rD   rC   rF   rG   rk  rl  r   rm  rn  ro  rp  r  r  rq  rr  rs  rt  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                          rQ   *quantized_mat_mul_with_bias_and_dequantizer  )  su   , 
			0h..0$#\\
114dAq$ue/1C7M;')9	;g
 n w	2'K"";>+K"";>+"&&'79KL'88.!qt6;56;5CUCU8?<G<GAQ59
;!QX QK'""$C&&t,dC4F4Ft4Ls))'2I  +]  /  /1Cll-.0F ::L.fgO('	.] && -
##At,,## 
F
QeUE52D
g;!4D	 
 ## 
s0    )F3 3G:G!!G:9G:>H H/.H/z,raw_ops.QuantizedMatMulWithBiasAndDequantizec                 `   t        j                  |	d      }	|
d}
t        j                  |
d      }
|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t
        j                  t
        j                  t
        j                  t
        j                  t
        j                  g      \  }\  } t        j                  |g|t
        j                  t
        j                  t
        j                  t
        j                  t
        j                  g      \  }\  }t        j                  |g|t
        j                  t
        j                  g      \  }\  }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }| ||||||||g	}d|d|d	|d|	d|
d|d|f}t        j                  d
d||||      }t        j                         rt        j                   d|||       |\  }|S )Nrq  Frr  rs  rj  rt  ro  rp  r  s$   QuantizedMatMulWithBiasAndDequantizers   rT   r  )r;   r{  r>   rn   rV   rW   r   r   r   r   r   rZ   r.   r   r   rA   rG   rk  rl  r   rm  rn  ro  rp  r  r  rq  rr  rs  rt  r    r!   ru  rv  r  rP   rO   rJ   s                        rQ   r  r  )  sd   w	2'K"";>+K"";>+"&&'79KL22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ!88$wX_XfXfFij+w

 
 
8%

 
 
8%

 
 
8%

 
 
8%--.@'//R--.@'//RQeUE5:LN`a,(D(G[)	=+}k&(& Da$0C"&(' ""$.fgO('	.r\   QuantizedMatMulWithBiasAndRelu$TV_QuantizedMatMulWithBiasAndRelu_T1$TV_QuantizedMatMulWithBiasAndRelu_T2)TV_QuantizedMatMulWithBiasAndRelu_Toutputc                    t         j                   xs t        j                         }|j                  }|j                  r>	 t	        j
                  |d|| ||||||d|d|d|	d|
      }t        j                  |      }|S |t        j                   }t#        j$                  |d      }|d}t#        j&                  |d      }|	d}	t#        j&                  |	d      }	|
d	}
t#        j(                  |
d      }
t+        j,                  d| |||||||||	|
|
      \  }}}}|dd }t#        j.                         rd|j1                  d      d|j1                  d      d|j1                  d      d|j3                  d      d|j3                  d      d|j5                  d      f}|j6                  }t#        j8                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
||      S # t        j                  $ r Y w xY w)a	  Perform a quantized matrix multiplication of  `a` by the matrix `b` with bias
add and relu fusion.

  The inputs must be two-dimensional matrices and 1D bias vector. And the inner
  dimension of `a` (after being transposed if `transpose_a` is non-zero) must
  match the outer dimension of `b` (after being transposed if `transposed_b` is
  non-zero). Then do broadcast add operation with bias values on the matrix
  multiplication result. The bias size must match inner dimension of `b`. Then do
  relu activation to get non-negative result.

  Args:
    a: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      A matrix to be multiplied. Must be a two-dimensional tensor of type `quint8`.
    b: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      A matrix to be multiplied and must be a two-dimensional tensor of type `qint8`.
    bias: A `Tensor` of type `float32`.
      A 1D bias tensor with size matching with inner dimension of `b` (after being
      transposed if `transposed_b` is non-zero).
    min_a: A `Tensor` of type `float32`.
      The float value that the lowest quantized `a` value represents.
    max_a: A `Tensor` of type `float32`.
      The float value that the highest quantized `a` value represents.
    min_b: A `Tensor` of type `float32`.
      The float value that the lowest quantized `b` value represents.
    max_b: A `Tensor` of type `float32`.
      The float value that the highest quantized `b` value represents.
    Toutput: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.qint32`.
    transpose_a: An optional `bool`. Defaults to `False`.
      If true, `a` is transposed before multiplication.
    transpose_b: An optional `bool`. Defaults to `False`.
      If true, `b` is transposed before multiplication.
    input_quant_mode: An optional `string` from: `"MIN_FIRST", "SCALED"`. Defaults to `"MIN_FIRST"`.
      Input data quantization mode. Either MIN_FIRST(default) or SCALED.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (out, min_out, max_out).

    out: A `Tensor` of type `Toutput`.
    min_out: A `Tensor` of type `float32`.
    max_out: A `Tensor` of type `float32`.
  r  rq  rr  rs  rt  Nrv  Frj  rw  ro  rp  )r&   r   r'   r(   r   r)   %_QuantizedMatMulWithBiasAndReluOutputr+   r,   r-   r.   r/   r0   3quantized_mat_mul_with_bias_and_relu_eager_fallbackr4   rW   r   r;   r{  r>   rn   r?   r@   rA   rE   rD   rC   rF   rG   rz  s                        rQ   $quantized_mat_mul_with_bias_and_relur  *  s{   V 
			0h..0$#\\
11.aD%ueY{$68HJg 6;;GDgn _nnGw	2'K"";>+K"";>+"&&'79KL'88(AU05U05w6A6A;K/35!QX QK'""$C&&t,dC4F4Ft4L++I6  /  /1Cll-.	0F
 ::L(,I177@'	.W && -
##At,,## 
@
QeUE5'!{+$DB B ## 
s0    <G H)HHH!H9 9IIz&raw_ops.QuantizedMatMulWithBiasAndReluc                    |t         j                  }t        j                  |d      }|d}t        j                  |d      }|	d}	t        j                  |	d      }	|
d}
t        j
                  |
d      }
t        j                  | g|t         j                  t         j                  t         j                  t         j                  t         j                  g      \  }\  } t        j                  |g|t         j                  t         j                  t         j                  t         j                  t         j                  g      \  }\  }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }| ||||||g}d|d|d|d|d|	d|
f}t        j                  d	d
||||      }t        j                         rt        j                   d|||       t"        j%                  |      }|S )Nrq  Frr  rs  rj  rt  ro  rp  s   QuantizedMatMulWithBiasAndRelur  rT   r  )rW   r   r;   r{  r>   rn   rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   )rk  rl  r   rm  rn  ro  rp  rq  rr  rs  rt  r    r!   ru  rv  rP   rO   rJ   s                     rQ   r  r  s*  s*   _nnGw	2'K"";>+K"";>+"&&'79KL22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ			goo	6$

 
 
8%

 
 
8%

 
 
8%

 
 
8%QeUE59,(D(Iw}k+=& >$0C"&(' ""$(,I177@'	.r\   +QuantizedMatMulWithBiasAndReluAndRequantize1TV_QuantizedMatMulWithBiasAndReluAndRequantize_T11TV_QuantizedMatMulWithBiasAndReluAndRequantize_T24TV_QuantizedMatMulWithBiasAndReluAndRequantize_Tbias6TV_QuantizedMatMulWithBiasAndReluAndRequantize_Toutputc                    t         j                   xs t        j                         }|j                  }|j                  r@	 t	        j
                  |d|| ||||||||d|	d|
d|d|      }t        j                  |      }|S |	t        j                   }	t#        j$                  |	d      }	|
d}
t#        j&                  |
d      }
|d}t#        j&                  |d      }|d	}t#        j(                  |d      }t+        j,                  d| |||||||||	|
|||
      \  }}}}|dd }t#        j.                         rd|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j3                  d      d|j3                  d      d|j5                  d      f}|j6                  }t#        j8                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
||||      S # t        j                  $ r Y w xY w)a<
  Perform a quantized matrix multiplication of  `a` by the matrix `b` with bias
add and relu and requantize fusion.

  The inputs must be two-dimensional matrices and 1D bias vector. And the inner
  dimension of `a` (after being transposed if `transpose_a` is non-zero) must
  match the outer dimension of `b` (after being transposed if `transposed_b` is
  non-zero). Then do broadcast add operation with bias values on the matrix
  multiplication result. The bias size must match inner dimension of `b`.  Then do
  relu activation to get non-negative result. Then do requantize operation to get
  final uint8 result.

  Args:
    a: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      A matrix to be multiplied. Must be a two-dimensional tensor of type `quint8`.
    b: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      A matrix to be multiplied and must be a two-dimensional tensor of type `qint8`.
    bias: A `Tensor`. Must be one of the following types: `float32`, `qint32`.
      A 1D bias tensor with size matching with inner dimension of `b` (after being
      transposed if `transposed_b` is non-zero).
    min_a: A `Tensor` of type `float32`.
      The float value that the lowest quantized `a` value represents.
    max_a: A `Tensor` of type `float32`.
      The float value that the highest quantized `a` value represents.
    min_b: A `Tensor` of type `float32`.
      The float value that the lowest quantized `b` value represents.
    max_b: A `Tensor` of type `float32`.
      The float value that the highest quantized `b` value represents.
    min_freezed_output: A `Tensor` of type `float32`.
      The float value that the highest quantized output value after requantize.
    max_freezed_output: A `Tensor` of type `float32`.
    Toutput: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.quint8`.
    transpose_a: An optional `bool`. Defaults to `False`.
      If true, `a` is transposed before multiplication.
    transpose_b: An optional `bool`. Defaults to `False`.
      If true, `b` is transposed before multiplication.
    input_quant_mode: An optional `string` from: `"MIN_FIRST", "SCALED"`. Defaults to `"MIN_FIRST"`.
      Input data quantization mode. Either MIN_FIRST(default) or SCALED.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (out, min_out, max_out).

    out: A `Tensor` of type `Toutput`.
    min_out: A `Tensor` of type `float32`.
    max_out: A `Tensor` of type `float32`.
  r  rq  rr  rs  rt  Nrv  Frj  r  ro  rp  r  )r&   r   r'   r(   r   r)   2_QuantizedMatMulWithBiasAndReluAndRequantizeOutputr+   r,   r-   r.   r/   r0   Bquantized_mat_mul_with_bias_and_relu_and_requantize_eager_fallbackr4   rW   r   r;   r{  r>   rn   r?   r@   rA   rE   rD   rC   rF   rG   r  s                          rQ   3quantized_mat_mul_with_bias_and_relu_and_requantizer  *  s   ^ 
			0h..0$#\\11;T1aueU$68J7M;')9	;g
 CHHQgn _nnGw	2'K"";>+K"";>+"&&'79KL'885ad=B=B=B=BJ\J\?FCNCNHX<@B!QX QK'""$C&&t,dC4F4Ft4Ls))'2I  +]  /  /1Cll-.0F ::L5|VWV>DDWM'	.e && -
##At,,## 
O
QeUE52D
g;!4D	 
 ## 
0    >G+ +H2>HH21H26I I'&I'z3raw_ops.QuantizedMatMulWithBiasAndReluAndRequantizec                    |	t         j                  }	t        j                  |	d      }	|
d}
t        j                  |
d      }
|d}t        j                  |d      }|d}t        j
                  |d      }t        j                  | g|t         j                  t         j                  t         j                  t         j                  t         j                  g      \  }\  } t        j                  |g|t         j                  t         j                  t         j                  t         j                  t         j                  g      \  }\  }t        j                  |g|t         j                  t         j                  g      \  }\  }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }| ||||||||g	}d|d|d	|d|	d|
d|d|f}t        j                  d
d||||      }t        j                         rt        j                   d|||       t"        j%                  |      }|S )Nrq  Frr  rs  rj  rt  ro  rp  r  s+   QuantizedMatMulWithBiasAndReluAndRequantizer  rT   r  )rW   r   r;   r{  r>   rn   rV   r   r   r   r   rZ   r.   r   r   rA   rG   r  r+   r  s                        rQ   r  r  +  s{   _nnGw	2'K"";>+K"";>+"&&'79KL22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ!88$wX_XfXfFij+w

 
 
8%

 
 
8%

 
 
8%

 
 
8%--.@'//R--.@'//RQeUE5:LN`a,(D(G[)	=+}k&(& K|6s"&(' ""$5|VWV>DDWM'	.r\   $QuantizedMatMulWithBiasAndRequantize*TV_QuantizedMatMulWithBiasAndRequantize_T1*TV_QuantizedMatMulWithBiasAndRequantize_T2-TV_QuantizedMatMulWithBiasAndRequantize_Tbias/TV_QuantizedMatMulWithBiasAndRequantize_Toutputc                    t         j                   xs t        j                         }|j                  }|j                  r@	 t	        j
                  |d|| ||||||||d|	d|
d|d|      }t        j                  |      }|S |	t        j                   }	t#        j$                  |	d      }	|
d}
t#        j&                  |
d      }
|d}t#        j&                  |d      }|d	}t#        j(                  |d      }t+        j,                  d| |||||||||	|
|||
      \  }}}}|dd }t#        j.                         rd|j1                  d      d|j1                  d      d|j1                  d      d|j1                  d      d|j3                  d      d|j3                  d      d|j5                  d      f}|j6                  }t#        j8                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
||||      S # t        j                  $ r Y w xY w)a  TODO: add doc.

  Args:
    a: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    b: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    bias: A `Tensor`. Must be one of the following types: `float32`, `qint32`.
    min_a: A `Tensor` of type `float32`.
    max_a: A `Tensor` of type `float32`.
    min_b: A `Tensor` of type `float32`.
    max_b: A `Tensor` of type `float32`.
    min_freezed_output: A `Tensor` of type `float32`.
    max_freezed_output: A `Tensor` of type `float32`.
    Toutput: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.quint8`.
    transpose_a: An optional `bool`. Defaults to `False`.
    transpose_b: An optional `bool`. Defaults to `False`.
    input_quant_mode: An optional `string` from: `"MIN_FIRST", "SCALED"`. Defaults to `"MIN_FIRST"`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (out, min_out, max_out).

    out: A `Tensor` of type `Toutput`.
    min_out: A `Tensor` of type `float32`.
    max_out: A `Tensor` of type `float32`.
  r  rq  rr  rs  rt  Nrv  Frj  r  ro  rp  r  )r&   r   r'   r(   r   r)   +_QuantizedMatMulWithBiasAndRequantizeOutputr+   r,   r-   r.   r/   r0   9quantized_mat_mul_with_bias_and_requantize_eager_fallbackr4   rW   r   r;   r{  r>   rn   r?   r@   rA   rE   rD   rC   rF   rG   r  s                          rQ   *quantized_mat_mul_with_bias_and_requantizer  <+  s   4 
			0h..0$#\\114dAq$ue/1C7M;')9	;g
 <AA'Jgn _nnGw	2'K"";>+K"";>+"&&'79KL'88.!qt6;56;5CUCU8?<G<GAQ59
;!QX QK'""$C&&t,dC4F4Ft4Ls))'2I  +]  /  /1Cll-.0F ::L.fgO7==gF'	.a && -
##At,,## 
F
QeUE52D
g;!4D	 
 ## 
r  z,raw_ops.QuantizedMatMulWithBiasAndRequantizec                    |	t         j                  }	t        j                  |	d      }	|
d}
t        j                  |
d      }
|d}t        j                  |d      }|d}t        j
                  |d      }t        j                  | g|t         j                  t         j                  t         j                  t         j                  t         j                  g      \  }\  } t        j                  |g|t         j                  t         j                  t         j                  t         j                  t         j                  g      \  }\  }t        j                  |g|t         j                  t         j                  g      \  }\  }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }| ||||||||g	}d|d|d	|d|	d|
d|d|f}t        j                  d
d||||      }t        j                         rt        j                   d|||       t"        j%                  |      }|S )Nrq  Frr  rs  rj  rt  ro  rp  r  s$   QuantizedMatMulWithBiasAndRequantizer  rT   r  )rW   r   r;   r{  r>   rn   rV   r   r   r   r   rZ   r.   r   r   rA   rG   r  r+   r  s                        rQ   r  r  +  s{   _nnGw	2'K"";>+K"";>+"&&'79KL22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ22A3gmmW^^]d]k]kmtm{m{  ~E  ~M  ~M  >P  Q.(DQ!88$wX_XfXfFij+w

 
 
8%

 
 
8%

 
 
8%

 
 
8%--.@'//R--.@'//RQeUE5:LN`a,(D(G[)	=+}k&(& Da$0C"&(' ""$.fgO7==gF'	.r\   QuantizedMaxPoolTV_QuantizedMaxPool_Tc                    t         j                   xs t        j                         }|j                  }|j                  r8	 t	        j
                  |d|| ||d|d|d|      }	t        j                  |	      }	|	S t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t        |t         t"        f      st%        d|z        |D cg c]  }t'        j(                  |d       }}t'        j*                  |d      }t-        j.                  d| ||||||	      \  }}}}|dd }	t'        j0                         rjd
|j3                  d
      d|j5                  d      d|j5                  d      d|j5                  d      f}|j6                  }t'        j8                  d|||	       t        j                  |	      }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y w xY wc c}w c c}w )a  Produces the max pool of the input tensor for quantized types.

  Args:
    input: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
      The 4D (batch x rows x cols x depth) Tensor to MaxReduce over.
    min_input: A `Tensor` of type `float32`.
      The float value that the lowest quantized input value represents.
    max_input: A `Tensor` of type `float32`.
      The float value that the highest quantized input value represents.
    ksize: A list of `ints`.
      The size of the window for each dimension of the input tensor.
      The length must be 4 to match the number of dimensions of the input.
    strides: A list of `ints`.
      The stride of the sliding window for each dimension of the input
      tensor. The length must be 4 to match the number of dimensions of the input.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output, min_output, max_output).

    output: A `Tensor`. Has the same type as `input`.
    min_output: A `Tensor` of type `float32`.
    max_output: A `Tensor` of type `float32`.
  r  re   rf   r`   Nr>  FExpected list for 'ksize' argument to 'quantized_max_pool' Op, not %r.HExpected list for 'strides' argument to 'quantized_max_pool' Op, not %r.rA  r%   )r&   r   r'   r(   r   r)   _QuantizedMaxPoolOutputr+   r,   r-   r.   r/   r0   !quantized_max_pool_eager_fallbackr4   rk   rl   rm   r5   r;   r<   rn   r?   r@   rA   rE   rC   rF   rG   rD  s                    rQ   quantized_max_poolr  +  rF  rG  zraw_ops.QuantizedMaxPoolc           	         t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j                  |d      }t	        j                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }	\  } t        j                  |t        j                         }t        j                  |t        j                         }| ||g}
d|	d|d|d|f}t	        j"                  dd|
|||	      }t	        j$                         rt	        j&                  d
|
||       t(        j+                  |      }|S c c}w c c}w )Nr  re   r  rf   r`   r%   s   QuantizedMaxPoolr  rT   r  )rk   rl   rm   r5   r;   r<   rn   rV   rW   r   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   rI  s                rQ   r  r  ,  rJ  rK  QuantizedRelu)activationsmin_activationsmax_activationsTV_QuantizedRelu_TinputTV_QuantizedRelu_out_typemin_featuresmax_featuresc           
      R   t         j                   xs t        j                         }|j                  }|j                  r4	 t	        j
                  |d|| ||d|      }t        j                  |      }|S |t        j                   }t#        j$                  |d      }t'        j(                  d| ||||      \  }	}	}
}|dd }t#        j*                         rHd|
j-                  d      d|
j-                  d      f}|
j.                  }t#        j0                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||      S # t        j                  $ r Y 2w xY w)a8  Computes Quantized Rectified Linear: `max(features, 0)`

  Args:
    features: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    min_features: A `Tensor` of type `float32`.
      The float value that the lowest quantized value represents.
    max_features: A `Tensor` of type `float32`.
      The float value that the highest quantized value represents.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.quint8`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (activations, min_activations, max_activations).

    activations: A `Tensor` of type `out_type`.
    min_activations: A `Tensor` of type `float32`.
    max_activations: A `Tensor` of type `float32`.
  r  r\  Nrn  r  r  r  r\  r    r^  )r&   r   r'   r(   r   r)   _QuantizedReluOutputr+   r,   r-   r.   r/   r0   quantized_relu_eager_fallbackr4   rW   r   r;   r{  r?   r@   rA   rE   rF   rG   r  r  r  r\  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                 rQ   quantized_relur  .,  s   & 
			0h..0$#\\	11otX|\Hg %**73gn ~~H*5('88(&2X"$!QX QK'""$**84j  ,.F::Lvw8 &&w/'	.5 && -
##At,,## 
*
L,  ## 
0    2D3 3E:E!!E:9E:>F F&%F&zraw_ops.QuantizedReluc           	         |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  t         j                  t         j                  t         j                  g      \  }\  } t        j                  |t         j                        }t        j                  |t         j                        }| ||g}d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d|||	       t        j!                  |	      }	|	S )Nr\  r^  s   QuantizedRelur  rT   r  )rW   r   r;   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   
r  r  r  r\  r    r!   rc  rP   rO   rJ   s
             rQ   r  r  i,  s)   ~~H*5(&==xj#PWP]P]_f_m_movo}o}  @G  @N  @N  PW  P_  P_  Pb  c,''gooF,''gooF,L,7,lJ9&-q#)s?'""$vw8 &&w/'	.r\   QuantizedRelu6TV_QuantizedRelu6_TinputTV_QuantizedRelu6_out_typec           
      R   t         j                   xs t        j                         }|j                  }|j                  r4	 t	        j
                  |d|| ||d|      }t        j                  |      }|S |t        j                   }t#        j$                  |d      }t'        j(                  d| ||||      \  }	}	}
}|dd }t#        j*                         rHd|
j-                  d      d|
j-                  d      f}|
j.                  }t#        j0                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||      S # t        j                  $ r Y 2w xY w)aB  Computes Quantized Rectified Linear 6: `min(max(features, 0), 6)`

  Args:
    features: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    min_features: A `Tensor` of type `float32`.
      The float value that the lowest quantized value represents.
    max_features: A `Tensor` of type `float32`.
      The float value that the highest quantized value represents.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.quint8`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (activations, min_activations, max_activations).

    activations: A `Tensor` of type `out_type`.
    min_activations: A `Tensor` of type `float32`.
    max_activations: A `Tensor` of type `float32`.
  r  r\  Nrn  r  r^  )r&   r   r'   r(   r   r)   _QuantizedRelu6Outputr+   r,   r-   r.   r/   r0   quantized_relu6_eager_fallbackr4   rW   r   r;   r{  r?   r@   rA   rE   rF   rG   r  s                 rQ   quantized_relu6r  ,  s   & 
			0h..0$#\\	11hlHg &++G4gn ~~H*5('888,'3h#%!QX QK'""$**84j  ,.F::L,9!''0'	.5 && -
##At,,## 
+
L,  ## 
r  zraw_ops.QuantizedRelu6c           	         |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  t         j                  t         j                  t         j                  g      \  }\  } t        j                  |t         j                        }t        j                  |t         j                        }| ||g}d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d|||	       t        j!                  |	      }	|	S )Nr\  r^  s   QuantizedRelu6r  rT   r  )rW   r   r;   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   r  s
             rQ   r  r  ,  s)   ~~H*5(&==xj#PWP]P]_f_m_movo}o}  @G  @N  @N  PW  P_  P_  Pb  c,''gooF,''gooF,L,7,lJ9&.,#)s?'""$,9!''0'	.r\   QuantizedReluXTV_QuantizedReluX_TinputTV_QuantizedReluX_out_type	max_valuec                 X   t         j                   xs t        j                         }|j                  }|j                  r5	 t	        j
                  |d|| |||d|	      }t        j                  |      }|S |t        j                   }t#        j$                  |d      }t'        j(                  d| |||||      \  }
}
}}|dd }t#        j*                         rHd|j-                  d      d|j-                  d      f}|j.                  }t#        j0                  d|||       t        j                  |      }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y 4w xY w)aw  Computes Quantized Rectified Linear X: `min(max(features, 0), max_value)`

  Args:
    features: A `Tensor`. Must be one of the following types: `qint8`, `quint8`, `qint32`, `qint16`, `quint16`.
    max_value: A `Tensor` of type `float32`.
    min_features: A `Tensor` of type `float32`.
      The float value that the lowest quantized value represents.
    max_features: A `Tensor` of type `float32`.
      The float value that the highest quantized value represents.
    out_type: An optional `tf.DType` from: `tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16`. Defaults to `tf.quint8`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (activations, min_activations, max_activations).

    activations: A `Tensor` of type `out_type`.
    min_activations: A `Tensor` of type `float32`.
    max_activations: A `Tensor` of type `float32`.
  r  r\  Nrn  )r  r  r  r  r\  r    r^  )r&   r   r'   r(   r   r)   _QuantizedReluXOutputr+   r,   r-   r.   r/   r0   quantized_relu_x_eager_fallbackr4   rW   r   r;   r{  r?   r@   rA   rE   rF   rG   )r  r  r  r  r\  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                  rQ   quantized_relu_xr  ,  s   ( 
			0h..0$#\\	11h	<j(,g &++G4gn ~~H*5('888y'3'3h#	%!QX
 QK'""$**84j  ,.F::L,9!''0'	.7 && -
##At,,## 
,
I|\H  ## 
s0    3D5 5E<E##E<;E< F F)(F)zraw_ops.QuantizedReluXc           	         |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  t         j                  t         j                  t         j                  g      \  }\  } t        j                  |t         j                        }t        j                  |t         j                        }t        j                  |t         j                        }| |||g}d|d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d||	|
       t        j!                  |
      }
|
S )Nr\  r^  s   QuantizedReluXr  rT   r  )rW   r   r;   r{  rV   r   r   r   r   r.   r   rZ   r   rA   rG   r  r+   )r  r  r  r  r\  r    r!   rc  rP   rO   rJ   s              rQ   r  r  -  sA   ~~H*5(&==xj#PWP]P]_f_m_movo}o}  @G  @N  @N  PW  P_  P_  Pb  c,$$Y@)''gooF,''gooF,I|\B,lJ9&.,#)s?'""$,9!''0'	.r\   	TV_Relu_Tznn.reluc           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)a  Computes rectified linear: `max(features, 0)`.

  See: https://en.wikipedia.org/wiki/Rectifier_(neural_networks)
  Example usage:
  >>> tf.nn.relu([-2., 0., 3.]).numpy()
  array([0., 0., 3.], dtype=float32)

  Args:
    features: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`, `qint8`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `features`.
  ReluNr   r"   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   _dispatcher_for_relur2   relu_eager_fallbackr4   r5   r6   r7   r   relur8   r9   r:   r?   r@   r;   rA   rE   rF   rG   r  s              rQ   r  r  (-  s   $ 
			0h..0$#\\11fdH&gn, #	44!Gn$n	
)::.Aq#x QK'""$3%%c*+F::Lfg/('	.W && -
##At,,## 
$T
T#g		& 
4) )## 
z" """dH48g 
	..<<	<  Z	  
  
D(6
G i,,:::n	
r  zraw_ops.Reluc                 j   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } | g}d|f}t        j                   dd||||      }t        j"                         rt        j$                  d|||       |\  }|S )Nr%   s   Relurs   rT   r  )r;   rV   rW   rZ   ru   r   r   r   r   r   rY   r   rX   r   r   r   r   rA   rG   r  s          rQ   r  r  r-  sm   !88(S7??\c\k\kmtmzmz  }D  }J  }J  LS  LY  LY  [b  [g  [g  ip  iv  iv  x  xH  xH  JQ  JX  JX  Za  Zf  Zf  ho  hv  hv  x  xF  xF  HO  HU  HU  KX  Y';H,>&WaF!$41'""$fg/('	.r\   
TV_Relu6_Tc                 ~   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r7d|j#                  d      f}	|j$                  }
t        j&                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)ab  Computes rectified linear 6: `min(max(features, 0), 6)`.

  Args:
    features: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `features`.
  Relu6Nr   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   relu6_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  s              rQ   relu6r  -  s7    
			0h..0$#\\11gtX'gn (88(/!QXQK'""$3%%c*+F::Lvw0('	.' && -
##At,,## 
!
4) )## 
r  zraw_ops.Relu6c                 L   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }\  } | g}d|f}t        j                  dd||||      }t        j                          rt        j"                  d|||       |\  }|S )Nr%   s   Relu6rs   rT   r  r;   rV   rW   rZ   ru   r   r   r   r   r   rY   r   rX   r   r   r   rA   rG   r  s          rQ   r  r  -  sX   !88(S7??\c\k\kmtmzmz  }D  }J  }J  LS  LY  LY  [b  [g  [g  ip  iv  iv  x  xH  xH  JQ  JX  JX  Za  Zf  Zf  ho  hv  hv  x  xF  xF  KI  J';H,>&XqV!$41'""$vw0('	.r\   TV_Relu6Grad_Tc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        j                  d| ||      \  }}}}	|	dd }t        j                          r7d|j#                  d      f}
|j$                  }t        j&                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a|  Computes rectified linear 6 gradients for a Relu6 operation.

  Args:
    gradients: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      The backpropagated gradients to the corresponding Relu6 operation.
    features: A `Tensor`. Must have the same type as `gradients`.
      The features passed as input to the corresponding Relu6 operation, or
      its output; using either one produces the same result.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `gradients`.
  	Relu6GradNr   r  r  r    r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   relu6_grad_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s               rQ   
relu6_gradr  -  s>    
			0h..0$#\\11k4H6gn (88y8$H!QXQK'""$3%%c*+F::L\674('	.' && -
##At,,## 
&
XDd4 4## 
r   zraw_ops.Relu6Gradc                 V   t        j                  | |g|t        j                  t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }}|\  } }| |g}d|f}t        j                  dd||||      }t        j                          rt        j"                  d|||       |\  }|S )Nr%   s	   Relu6Gradrs   rT   r  r  	r  r  r    r!   r[   r   rP   rO   rJ   s	            rQ   r  r  -  sq   66	87LcT[TcTceletetv}  wD  wD  FM  FS  FS  U\  Ub  Ub  dk  dp  dp  ry  r  r  AH  AQ  AQ  SZ  Sa  Sa  cj  co  co  qx  q  q  AH  AO  AO  TR  S'9#9hX&,>&\1\#)s?'""$\674('	.r\   TV_ReluGrad_Tc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        j                  d| ||      \  }}}}	|	dd }t        j                          r7d|j#                  d      f}
|j$                  }t        j&                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)ax  Computes rectified linear gradients for a Relu operation.

  Args:
    gradients: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      The backpropagated gradients to the corresponding Relu operation.
    features: A `Tensor`. Must have the same type as `gradients`.
      The features passed as input to the corresponding Relu operation, OR
      the outputs of that operation (both work equivalently).
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `gradients`.
  ReluGradNr   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   relu_grad_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  s               rQ   	relu_gradr  -  s>    
			0h..0$#\\11j$	85gn (88i(G!QXQK'""$3%%c*+F::LL&'3('	.' && -
##At,,## 
%
XDd4 4## 
r   zraw_ops.ReluGradc                 V   t        j                  | |g|t        j                  t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  g      \  }}|\  } }| |g}d|f}t        j                  dd||||      }t        j                          rt        j"                  d|||       |\  }|S )Nr%   s   ReluGradrs   rT   r  r  r  s	            rQ   r  r  #.  sq   66	87LcT[TcTceletetv}  wD  wD  FM  FS  FS  U\  Ub  Ub  dk  dp  dp  ry  r  r  AH  AQ  AQ  SZ  Sa  Sa  cj  co  co  qx  q  q  AH  AO  AO  TR  S'9#9hX&,>&[!L#)s?'""$L&'3('	.r\   	TV_Selu_Tznn.seluc           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)aB  Computes scaled exponential linear: `scale * alpha * (exp(features) - 1)`

  if < 0, `scale * features` otherwise.

  To be used together with
  `initializer = tf.variance_scaling_initializer(factor=1.0, mode='FAN_IN')`.
  For correct dropout, use `tf.contrib.nn.alpha_dropout`.

  See [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)

  Args:
    features: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `features`.
  SeluNr   r"   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   _dispatcher_for_selur2   selu_eager_fallbackr4   r5   r6   r7   r   selur8   r9   r:   r?   r@   r;   rA   rE   rF   rG   r  s              rQ   r  r  3.  s   * 
			0h..0$#\\11fdH&gn, #	44!Gn$n	
)::.Aq#x QK'""$3%%c*+F::Lfg/('	.W && -
##At,,## 
$T
T#g		& 
4) )## 
z" """dH48g 
	..<<	<  Z	  
  
D(6
G i,,:::n	
r  zraw_ops.Seluc                 \   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  g      \  }\  } | g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   Selurs   rT   r  r  r  s          rQ   r  r  .  s    !88(S7<<Y`YiYikrkzkz  }D  }L  }L  KO  P';H,>&WaF!$41'""$fg/('	.r\   TV_SeluGrad_Tc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        j                  d| ||      \  }}}}	|	dd }t        j                          r7d|j#                  d      f}
|j$                  }t        j&                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a  Computes gradients for the scaled exponential linear (Selu) operation.

  Args:
    gradients: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      The backpropagated gradients to the corresponding Selu operation.
    outputs: A `Tensor`. Must have the same type as `gradients`.
      The outputs of the corresponding Selu operation.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `gradients`.
  SeluGradNr   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   selu_grad_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  s               rQ   	selu_gradr  .  s>    
			0h..0$#\\11j$	74gn (88itE!QXQK'""$3%%c*+F::LL&'3('	.' && -
##At,,## 
%
W4T3 3## 
r   zraw_ops.SeluGradc                 f   t        j                  | |g|t        j                  t        j                  t        j
                  t        j                  g      \  }}|\  } }| |g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   SeluGradrs   rT   r  r  r  s	            rQ   r  r  .  s    66	77KSSZS_S_ahaqaqsz  tC  tC  EL  ET  ET  SW  X'9"9gW%,>&[!L#)s?'""$L&'3('	.r\   TV_Softmax_Tc                 ~   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r7d|j#                  d      f}	|j$                  }
t        j&                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)a  Computes softmax activations.

  For each batch `i` and class `j` we have

      $$softmax[i, j] = exp(logits[i, j]) / sum_j(exp(logits[i, j]))$$

  Args:
    logits: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      2-D with shape `[batch_size, num_classes]`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `logits`.
  SoftmaxNr   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   softmax_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  s              rQ   softmaxr   .  s7    
			0h..0$#\\11iv'gn (88&t-!QXQK'""$3%%c*+F::L<2('	.' && -
##At,,## 
#
t' '## 
r  zraw_ops.Softmaxc                 \   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  g      \  }\  } | g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   Softmaxrs   rT   r  r  r  s          rQ   r  r  .  s    66xw||U\UeUegngvgvx  yH  yH  GK  L'9F,>&Z<v!$41'""$<2('	.r\   SoftmaxCrossEntropyWithLogitsloss"TV_SoftmaxCrossEntropyWithLogits_Tlabelsc                    t         j                   xs t        j                         }|j                  }|j                  r1	 t	        j
                  |d|| |      }t        j                  |      }|S t        j                   d| ||      \  }}}}	|	dd }t#        j$                         r7d|j'                  d      f}
|j(                  }t#        j*                  d||
|       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a  Computes softmax cross entropy cost and gradients to backpropagate.

  Inputs are the logits, not probabilities.

  Args:
    features: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      batch_size x num_classes matrix
    labels: A `Tensor`. Must have the same type as `features`.
      batch_size x num_classes matrix
      The caller must ensure that each batch of labels represents a valid
      probability distribution.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (loss, backprop).

    loss: A `Tensor`. Has the same type as `features`.
    backprop: A `Tensor`. Has the same type as `features`.
  r  Nr   r  r  r    r%   )r&   r   r'   r(   r   r)   $_SoftmaxCrossEntropyWithLogitsOutputr+   r,   r-   r.   r/   r0   0softmax_cross_entropy_with_logits_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  r  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s               rQ   !softmax_cross_entropy_with_logitsr  /  s\   ( 
			0h..0$#\\11-tXvGg4::7Cgn (88'(6.24!QX QK'""$3%%c*+F::L'vwH066w?'	.) && -
##At,,## 
=
F41 1## 
s0    /C5 5D<D##D<;D< E E%$E%z%raw_ops.SoftmaxCrossEntropyWithLogitsc                    t        j                  | |g|t        j                  t        j                  t        j
                  t        j                  g      \  }}|\  } }| |g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr%   s   SoftmaxCrossEntropyWithLogitsrS   rT   r  )r;   rV   rW   rX   rY   rZ   ru   r   rA   rG   r  r+   )	r  r  r    r!   r[   r   rP   rO   rJ   s	            rQ   r	  r	  A/  s    66&7I3QXQ]Q]_f_o_oqx  rA  rA  CJ  CR  CR  QU  V'9 8VF#,>&=q$0C"&(' ""$'vwH066w?'	.r\   TV_Softplus_Tc                 ~   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r7d|j#                  d      f}	|j$                  }
t        j&                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)zTODO: add doc.

  Args:
    features: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `features`.
  SoftplusNr   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   softplus_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  s              rQ   softplusr  R/  s7    
			0h..0$#\\11j$*gn (88XD2!QXQK'""$3%%c*+F::LL&'3('	.' && -
##At,,## 
$
4) )## 
r  zraw_ops.Softplusc                 \   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  g      \  }\  } | g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   Softplusrs   rT   r  r  r  s          rQ   r  r  {/      !88(S7<<Y`YiYikrkzkz  }D  }L  }L  KO  P';H,>&[!L#)s?'""$L&'3('	.r\   TV_SoftplusGrad_Tc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        j                  d| ||      \  }}}}	|	dd }t        j                          r7d|j#                  d      f}
|j$                  }t        j&                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a  Computes softplus gradients for a softplus operation.

  Args:
    gradients: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      The backpropagated gradients to the corresponding softplus operation.
    features: A `Tensor`. Must have the same type as `gradients`.
      The features passed as input to the corresponding softplus operation.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `gradients`.
  SoftplusGradNr   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   softplus_grad_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  s               rQ   softplus_gradr  /  >    
			0h..0$#\\11ndIx9gn (88)hTK!QXQK'""$3%%c*+F::Lfg7('	.' && -
##At,,## 
)
XDd4 4## 
r   zraw_ops.SoftplusGradc                 f   t        j                  | |g|t        j                  t        j                  t        j
                  t        j                  g      \  }}|\  } }| |g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   SoftplusGradrs   rT   r  r  r  s	            rQ   r  r  /      66	87LcT[T`T`bibrbrt{  uD  uD  FM  FU  FU  TX  Y'9#9hX&,>&_a#)s?'""$fg7('	.r\   TV_Softsign_Tznn.softsignzmath.softsignc           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)a  Computes softsign: `features / (abs(features) + 1)`.

  Args:
    features: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `features`.
  SoftsignNr   r"   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   _dispatcher_for_softsignr2   softsign_eager_fallbackr4   r5   r6   r7   r   softsignr8   r9   r:   r?   r@   r;   rA   rE   rF   rG   r  s              rQ   r!  r!  /  s    
			0h..0$#\\11j$*gn, '	44!Gn$n	
)::XD2Aq#x QK'""$3%%c*+F::LL&'3('	.W && -
##At,,## 
(T
T#g		&$
4) )## 
z" ""b$t<g 
	..<<	<  Z	  
  
BhT:
G i,,:::n	
r  zraw_ops.Softsignc                 \   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  g      \  }\  } | g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   Softsignrs   rT   r  r  r  s          rQ   r   r   0  r  r\   TV_SoftsignGrad_Tc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        j                  d| ||      \  }}}}	|	dd }t        j                          r7d|j#                  d      f}
|j$                  }t        j&                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a  Computes softsign gradients for a softsign operation.

  Args:
    gradients: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      The backpropagated gradients to the corresponding softsign operation.
    features: A `Tensor`. Must have the same type as `gradients`.
      The features passed as input to the corresponding softsign operation.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `gradients`.
  SoftsignGradNr   r  r%   )r&   r   r'   r(   r   r)   r,   r-   r.   r/   r0   softsign_grad_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r  s               rQ   softsign_gradr'  0  r  r   zraw_ops.SoftsignGradc                 f   t        j                  | |g|t        j                  t        j                  t        j
                  t        j                  g      \  }}|\  } }| |g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr%   s   SoftsignGradrs   rT   r%  r  r  s	            rQ   r&  r&  F0  r  r\   #SparseSoftmaxCrossEntropyWithLogits(TV_SparseSoftmaxCrossEntropyWithLogits_T.TV_SparseSoftmaxCrossEntropyWithLogits_Tlabelsc                    t         j                   xs t        j                         }|j                  }|j                  r1	 t	        j
                  |d|| |      }t        j                  |      }|S t        j                   d| ||      \  }}}}	|	dd }t#        j$                         rHd|j'                  d      d|j'                  d      f}
|j(                  }t#        j*                  d||
|       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a  Computes softmax cross entropy cost and gradients to backpropagate.

  Unlike `SoftmaxCrossEntropyWithLogits`, this operation does not accept
  a matrix of label probabilities, but rather a single label per row
  of features.  This label is considered to have probability 1.0 for the
  given row.

  Inputs are the logits, not probabilities.

  Args:
    features: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      batch_size x num_classes matrix
    labels: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      batch_size vector with values in [0, num_classes).
      This is the label for the given minibatch entry.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (loss, backprop).

    loss: A `Tensor`. Has the same type as `features`.
    backprop: A `Tensor`. Has the same type as `features`.
  r)  Nr   r  r%   Tlabels)r&   r   r'   r(   r   r)   *_SparseSoftmaxCrossEntropyWithLogitsOutputr+   r,   r-   r.   r/   r0   7sparse_softmax_cross_entropy_with_logits_eager_fallbackr4   r?   r@   r;   rA   rE   rF   rG   r
  s               rQ   (sparse_softmax_cross_entropy_with_logitsr0  [0  so   0 
			0h..0$#\\113T8VMg:@@Ign (88-6<4I!QX QK'""$3%%c*I  +-F::L-|VWN6<<WE'	.+ && -
##At,,## 
D
F41 1## 
s0    /D ED44EEE   E76E7z+raw_ops.SparseSoftmaxCrossEntropyWithLogitsc                    t        j                  | g|t        j                  t        j                  t        j
                  t        j                  g      \  }\  } t        j                  |g|t        j                  t        j                  gt        j                        \  }\  }| |g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr%   r-  s#   SparseSoftmaxCrossEntropyWithLogitsrS   rT   r)  )r;   rV   rW   rX   rY   rZ   ru   r   r   r   rA   rG   r.  r+   )	r  r  r    r!   r[   _attr_TlabelsrP   rO   rJ   s	            rQ   r/  r/  0  s    !88(S7<<Y`YiYikrkzkz  }D  }L  }L  KO  P';H%<<fXsW]]\c\i\iLlnun{n{|-&F#,)]3&CQ$0C"&(' ""$-|VWN6<<WE'	.r\   TopK	TV_TopK_Tsortedc           
         t         j                   xs t        j                         }|j                  }|j                  r4	 t	        j
                  |d|| d|d|      }t        j                  |      }|S t        j                   |d      }|d}t        j"                  |d      }t%        j&                  d| |||      \  }}}	}
|
dd }t        j(                         rYd|	j+                  d      d|	j-                  d      d|	j/                  d      f}|	j0                  }t        j2                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y Iw xY w)	aA  Finds values and indices of the `k` largest elements for the last dimension.

  If the input is a vector (rank-1), finds the `k` largest entries in the vector
  and outputs their values and indices as vectors.  Thus `values[j]` is the
  `j`-th largest entry in `input`, and its index is `indices[j]`.

  For matrices (resp. higher rank input), computes the top `k` entries in each
  row (resp. vector along the last dimension).  Thus,

      values.shape = indices.shape = input.shape[:-1] + [k]

  If two elements are equal, the lower-index element appears first.

  If `k` varies dynamically, use `TopKV2` below.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      1-D or higher with last dimension at least `k`.
    k: An `int` that is `>= 0`.
      Number of top elements to look for along the last dimension (along each
      row for matrices).
    sorted: An optional `bool`. Defaults to `True`.
      If true the resulting `k` elements will be sorted by the values in
      descending order.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (values, indices).

    values: A `Tensor`. Has the same type as `input`.
    indices: A `Tensor` of type `int32`.
  r3  r   r5  N)r   r5  r    r!   T)r   r   r5  r    r%   )r&   r   r'   r(   r   r)   _TopKOutputr+   r,   r-   r.   r/   r0   top_k_eager_fallbackr4   r;   r<   r>   r?   r@   rA   rB   rD   rE   rF   rG   )r   r   r5  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                rQ   top_kr9  0  s   B 
			0h..0$#\\11fdE38V=g!!'*gn 3!^Ffh/&'88eqd<!QXQK'""$3$$S)8  *C1C1CC1HJF::Lfg/g&'	.1 && -
##At,,## 
!
1V$D: :## 
s0    2E FE99FFF& &F=<F=zraw_ops.TopKc                    t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   g      \  }\  } | g}d|d|d|f}t        j"                  dd||||      }t        j$                         rt        j&                  d|||       t(        j+                  |      }|S )	Nr   Tr5  r%   s   TopKrS   rT   r3  )r;   r<   r>   rV   rW   rZ   ru   r   r   r   r   r   rY   r   rX   r   r   r   rA   rG   r7  r+   )	r   r   r5  r    r!   r[   rP   rO   rJ   s	            rQ   r8  r8  0  s   3!^Ffh/&55ugsW__V]VeVegngtgtv}  wD  wD  FM  FS  FS  U\  Ua  Ua  cj  cp  cp  ry  rB  rB  DK  DR  DR  T[  T`  T`  bi  bp  bp  ry  r@  r@  EC  D'8E,Hfc73&WaF!$41'""$fg/g&'	.r\   TopKV2TV_TopKV2_TTV_TopKV2_TkTV_TopKV2_index_type
index_typec                    t         j                   xs t        j                         }|j                  }|j                  r5	 t	        j
                  |d|| |d|d|	      }t        j                  |      }|S |d}t        j                   |d      }|t"        j$                  }t        j&                  |d      }t)        j*                  d| ||||      \  }	}	}
}|dd }t        j,                         rjd|
j/                  d      d|
j1                  d      d	|
j1                  d	      d|
j1                  d      f}|
j2                  }t        j4                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||      S # t        j                  $ r Y nw xY w)
a  Finds values and indices of the `k` largest elements for the last dimension.

  If the input is a vector (rank-1), finds the `k` largest entries in the vector
  and outputs their values and indices as vectors.  Thus `values[j]` is the
  `j`-th largest entry in `input`, and its index is `indices[j]`.

  For matrices (resp. higher rank input), computes the top `k` entries in each
  row (resp. vector along the last dimension).  Thus,

      values.shape = indices.shape = input.shape[:-1] + [k]

  If two elements are equal, the lower-index element appears first.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      1-D or higher with last dimension at least `k`.
    k: A `Tensor`. Must be one of the following types: `int16`, `int32`, `int64`.
      0-D.  Number of top elements to look for along the last dimension (along each
      row for matrices).
    sorted: An optional `bool`. Defaults to `True`.
      If true the resulting `k` elements will be sorted by the values in
      descending order.
    index_type: An optional `tf.DType` from: `tf.int16, tf.int32, tf.int64`. Defaults to `tf.int32`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (values, indices).

    values: A `Tensor`. Has the same type as `input`.
    indices: A `Tensor` of type `index_type`.
  r;  r5  r?  N)r5  r?  r    r!   T)r   r   r5  r?  r    r%   Tk)r&   r   r'   r(   r   r)   _TopKV2Outputr+   r,   r-   r.   r/   r0   top_kv2_eager_fallbackr4   r;   r>   rW   r   r{  r?   r@   rA   rD   rE   rF   rG   )r   r   r5  r?  r    rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                 rQ   top_kv2rD  	1  s   @ 
			0h..0$#\\	11heQ&,g ##G,gn ^Ffh/&J!!*l;*'886j!QX QK'""$**84c  %tS-?-?-EC..|<>F ::L,1('	.9 && -
##At,,## 
#
6jtO O## 
s0    3E0 0F7FF76F7;G G#"G#zraw_ops.TopKV2c                    |d}t        j                  |d      }|t        j                  }t        j                  |d      }t        j
                  | g|t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   g      \  }\  } t        j
                  |g|t        j                  t        j                  t        j                  gt        j                        \  }\  }| |g}d|d|d|d|f}	t        j"                  dd||	||      }
t        j$                         rt        j&                  d	||	|
       t(        j+                  |
      }
|
S )
NTr5  r?  r%   rA  s   TopKV2rS   rT   r;  )r;   r>   rW   r   r{  rV   rZ   ru   r   r   r   r   rY   r   rX   r   r   r   rA   rG   rB  r+   )r   r   r5  r?  r    r!   r[   _attr_TkrP   rO   rJ   s              rQ   rC  rC  S1  s   ^Ffh/&J!!*l;*55ugsW__V]VeVegngtgtv}  wD  wD  FM  FS  FS  U\  Ua  Ua  cj  cp  cp  ry  rB  rB  DK  DR  DR  T[  T`  T`  bi  bp  bp  ry  r@  r@  EC  D'8E22A3gmmW]]\c\i\i=lnun{n{|.(DQ,fc7D(L&Y,f!$41'""$,1('	.r\   )r#   r$   Tr#   TN)r^   N)rx   N)N)r^   ri  N)FFFr   r   N)FN)r  rs   r^   TN)r  r^   TN)r   rs   rs   r  N)r  N)FFrj  N)TN(f  __doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   r&   r   r,   r   r;   tensorflow.python.frameworkr   rW   tensorflow.security.fuzzing.pyr   _atypesr	   _op_def_registryr
   r.   r   r?   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   r7    tensorflow.python.util.tf_exportr   typingr   r   r   typing_extensionsr   
namedtupler*   r   add_fallback_dispatch_listadd_type_based_api_dispatcherintfloatboolr   	to_raw_opr   _tf_type_based_dispatcherDispatchr1   r3   r]   strrp   rd   rj   rw   r   rz   r~   r   Int32r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r
  r  r  r  r  r  r   r  r  r"  r#  r%  r)  r*  r,  r4  r/  r3  r6  r?  r8  r=  rE  rM  rH  rK  rL  rO  rU  rQ  rT  rW  rX  r_  rZ  r^  rb  rm  rg  rk  rr  rv  rt  ru  rx  r  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  Int64r  r  r  r  r  r  r  r  r  r   r  r  r  Float32r  r  r  r  r%  r   r(  r  r&  r/  r+  r,  r1  r*  r0  r:  r7  r8  r<  r5  r;  rB  r?  r@  rD  r>  rC  rL  rI  rJ  rN  rH  rM  rQ  rX  rU  rW  rZ  ra  r^  r`  rc  Boolrk  rg  ri  rm  rq  ro  rp  ry  ru  rv  rZ   r|  rs  rz  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r
  r  r  r  r  r  r  r  r  r  r  r  r  r#  r!  r"  r+  r&  r'  r   r-  r%  r,  r/  r5  r3  r4  rB  r:  rE  r7  rC  r_  rP  rQ  ra  rL  r`  rq  rh  ri  rj  rs  re  rr  r  rx  ry  rz  r   r  rw  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r#  r  r  r  r%  r  r$  r1  r(  r)  r*  r+  r,  r3  r'  r2  r<  r6  r7  r8  r>  r5  r=  rG  rA  rB  rC  rI  r@  rH  rS  rL  rM  rN  rU  rK  rT  r`  rX  rY  rZ  r[  rb  rW  ra  rx  rf  rg  rh  ri  r{  rd  ry  r}  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r	  r  r  r  r  r  r  r  r  r  r!  r  r  r   r#  r'  r%  r&  r.  r*  r+  r0  r)  r/  r7  r4  r9  r3  r8  rB  r<  r=  r>  r   rD  r;  rC  r"   r\   rQ   <module>rb     s  
  6 7 1 7 9 F K 3 I C 8 6 % % '*K**y 
 +-?ARTbc
%%
((
>C	#"67 CC CUX Ckp C  AE C  jm C  DH C  ) &CJ -Y+,^T^^L-IJ
+EENN yo1E'F 3 eh y~   KO   ps   HL @ ~'9;LN_aopHIc</0 H3 H\_ Hv  AD  FR  AR  wS HT ')%
&~t~~h'?
@9S,->#? Z] lo   @I  JM  O[  J[  @\ 8 )+=?PRcestJi^ 34 Js J`c J  |E  FI  KY  FY  |Z JX +I)*>4>>*+EF	YsN/B%C ^a ps   DM  NQ  Sa  Na  Db 8 13EGXZkm{| JiW]]0B&C J9UXZlUlKm J  IL J  Z] J  u~  B  DV  V  uW JX 3	12>4>>/3RSYsGMM?Q5R Zcdgi{d{Z|   X[   jm   }F  GJ  L^  G^  }_ : -/ACTVgiwx IIc7==.@$A ISVXhShIi I  EH I  VY I  py  z}  O  zO  pP IV /i-.~t~~m/LM9S'--=O3P XabegwbwXx   TW   fi   yB  CF  HX  CX  yY : )00WYk  nB  DW  Yj  l}  M  O^  `o  q@  BP  Rb  dt  vE  GX  Zj  l|  ~N  P`  bq  )r %FYs<a7a-b Fgpqt  w\  r\  h] F  bk  lo  qV  lV  bW F  _h  il  nS  iS  _T F  ]f  gj  lQ  gQ  ]R F  fk F  HL F  \e  fi  kP  fP  \Q FP $Y9-W#XYgY]YgYg  iN  ZO  $P  IcKpFp<q v  AD  Fk  Ak  wl   qz  {~  @e  {e  qf   nw  x{  }b  xb  nc   lu  vy  {`  v`  la   uz   W[   kt  ux  z_  u_  k` " /Ek.D.D*"/$ +
 -44_as  vJ  L_  ar  tE  GU  Wf  hw  yH  JX  Zj  l|  ~M  O`  br  tD  FV  Xh  jy  -z )K3@i;i1j Koxy|  h  zh  pi K  nw  x{  }f  xf  ng K  py  z}  h  zh  pi K  u~  B  Dm  m  un K  BG K  dh KZ (ay1_'`aoaeaoao  qZ  b[  (\ $	#OxJx@y   H  IL  Nw  Iw  x   }F  GJ  Lu  Gu  }v   H  IL  Nw  Iw  x   DM  NQ  S|  N|  D}   QV   sw $ ~'9;OQdfw  zK  M[  ]l  n}  N  P^  `p  rB  DS  Uf  hx  zJ  L\  ^n  p  @6Ic</0 6	#|BS8T 6be 6  }F  GJ  LX  GX  }Y 6p ')%
&~t~~h'?
@9S,->#? yQTVbQbGc ru   FO  PS  Ua  Pa  Fb " -/ACWYln  BS  Uc  et  vE  GV  Xf  hx  zJ  L[  ]n  p@  BR  Td  fv  xG  H 6	#/?*? @ 6c 6hqru  xH  sH  iI 6p /i-.~t~~m/LMy>N9N/O ^a qz{~  AQ  |Q  rR   )+=?SUhj{  ~O  Q_  ap  rA  CR  Tb  dt  vF  HW  Yj  l|  ~N  P`  br  tC  D,yn!45 ,YsNGZ=[ ,ktux  {I  vI  lJ ,\ +I)*>4>>++FG	i^0C&D IVY[iViLj   {D  EH  JX  EX  {Y  K!35FHY[ikz{	
%%
((
6wy  L[  gi  z{  HI  PT Z	#y.) Z9S)^3L Z`c Z  HK Z  vy Z  DG Z  Yb  cf  hq  cq  Yr Z  ) &Zx !y !5655>> *yi8 *)CQZNB[ *or *  UX *  qt *  ~A *  QZ  [^  `i  [i  Qj *Z m%79JL]_mo~ BF  Z\  nt  @L  SW )C,- ykAQ7R fi   }A   jm   \e  fi  kv  fv  \w B 
%#	$^T^^F%;	<'3+;!< 'iPSU`P`Fa 'ux '  MQ '  sv '  QZ  [^  `k  [k  Ql 'T $$?ASUfhy  |J  K  ae  y{  MS  _k  rv p)C1J,J"K p[dehjqjwjwew[x p  IR  SV  Xq  Sq  Ir p  FI p  \` p  IL p  {D  EH  Jc  Ec  {d pd Ay!?@PfAgh (3@Y;Y1Z (jstw  zA  zG  zG  uG  kH (  Xa  be  g@  b@  XA (  UX (  lp (  RU (  py  z}  X  zX  pY (V &&CEWYjl}  @N  O 
%%
((
&' pt  HJ  \b  nz  AE XYs4O/O%P XZcdg  jE  eE  [F X  V_  `c  e@  `@  VA X  UX X  ko X  X[ X  JS  TW  Yt  Tt  Ju X ( ) &Xt E#CD^T^^TmEno ,E,_,_,h,h )(IcC^>^4_ (irsv  yT  tT  jU (  en  or  tO  oO  eP (  dg (  { (  ad (  H  IL  Ni  Ii  j (V ##=?QSdfw  zH  JY  Z  ^b  vx  JP  \h  os pygmm1C'D piX[]uXuNv p  GP  QT  Vn  Qn  Go p  CF p  Y] p  FI p  xA  BE  G_  B_  x` pd ?i =>~t~~Nc?de (iW]]@R6S (]fgj  mE  hE  ^F (  V_  `c  e}  `}  V~ (  RU (  im (  OR (  mv  wz  |T  wT  mU (V %%ACUWhj{  ~L  N]  ^ 
%%
((
%& lp  DF  X^  jv  }A VIc3M.M$N VXabe  hB  cB  YC V  S\  ]`  b|  ]|  S} V  QT V  gk V  TW V  FO  PS  Uo  Po  Fp V ' ) &Vp C	"AB>4>>RjCkl +C+]+]+f+f ('9SB\=\3] 'gpqt  wQ  rQ  hR '  bk  lo  qK  lK  bL '  `c '  w{ '  ]` '  {D  EH  Jd  Ed  {e 'T m%79JL]_mn |C  O^  ei V)C,- VykAQ7R Vfi Vwz V  nw  x{  }H  xH  nI Vp 
%#	$^T^^F%;	<3+;!< iPSU`P`Fa ux   HK   fo  ps  u@  p@  fA > $$?ARTeguv  [j  qu E)C1J,J"K EU^_bd}_}U~ E  OX  Y\  ^w  Yw  Ox E  LO E  zC  DG  Ib  Db  zc EN Ay!?@PfAgh 3@Y;Y1Z dmnq  tM  oM  eN   ^g  hk  mF  hF  ^G   [^   yB  CF  Ha  Ca  yb 8 &&CEWYjl}  @N  O 
%%
((
*,JKL13QR bi  uD  KO ~Ys4O/O%P ~`ijmovo|o|j|`} ~  NW  X[  ]x  Xx  Ny ~  MP ~  ^a ~  T]  ^a  c~  ^~  T ~ S M ) &~@ E#CD^T^^TmEno ,E,_,_,h,h )IcC^>^4_ oxy|  F  L  L  zL  pM   ]f  gj  lG  gG  ]H   \_   nq   LU  VY  [v  Vv  Lw B ##=?PRcest  Wf  mq E30H+H!I ES\]`bz]zS{ E  LU  VY  [s  Vs  Lt E  HK E  v  @C  E]  @]  v^ EN ?i =>~t~~Nc?de 	#?W:W0X bklo  rJ  mJ  cK   [d  eh  jB  eB  [C   WZ   u~  B  D\  \  u] 8 %%ACUWhj{  ~L  M ")*K_^m"n  qx  DS  Z^ X)C9X4X*Y Xclmp  sM  nM  dN X  ^g  hk  mG  hG  ^H X  \_ X  mp X  cl  mp  rL  mL  cM Xt C	"AB>4>>RjCkl 3HgCg9h r{|  B\  }\  s]   mv  wz  |V  wV  mW   kn   }@   [d  eh  jD  eD  [E @   7/Z 79S*?%?@ 7S 7dg 7  H  IL  Nc  Ic  d 7r 9978H[9\] )C9N4N*O ]` nq   BK  LO  Qf  Lf  Bg & $$?Rab Ty.G)GH TUX Tlo T  GP  QT  Vo  Qo  Gp Tl Ay!?@PgAhi i=V8V.W eh vy   JS  TW  Yr  Tr  Js & %%ACUWhj{  ~L  M  mo  AG  S_  fj m9S2L-L#M mW`ad  gA  bA  XB m  VY m  }@ m  ox  y|  ~X  yX  oY m^ C	"AB>4>>RiCjk $)CA[<[2\ $fops  vP  qP  gQ $  eh $  JM $  hq  ru  wQ  rQ  hR $N ,33]_q  tE  GX  Zh  ,i ( LN  `f  r~  EI i9SBj=j3k i  |E  FI  KR  KX  KX  FX  |Y i  ir  sv  x`  s`  ia i  ux i  \_ i  NW  X[  ]E  XE  NF iV '_i0]&^_m_c_m_m  oV  `W  'X #&)CQyLyBz &  KT  UX  Za  Zg  Zg  Ug  Kh &  xA  BE  Go  Bo  xp &  DG &  il &  GP  QT  V~  Q~  G &R +22[]o  rC  EV  Xf  +g ' IK  ]c  o{  BF h	#w}}BT8U h_hil  oV  jV  `W h  gp  qt  v]  q]  g^ h  ru h  Y\ h  KT  UX  ZA  UA  KB hT &]Y/[%\]k]a]k]k  mS  ^T  &U "&yQTV]VcVcQcGd &nwx{  ~e  ye  of &  v  @C  El  @l  vm &  AD &  fi &  DM  NQ  Sz  Nz  D{ &R +-?ARTegu  xG  IX  Zi  ky  {K  M]  _o  q@  AWi_ 45 WyoI]?^ Wy| W  MV  WZ  \k  Wk  Ml Wr -Y+,^T^^J-GH
YsO/C%D iX[]lXlNm   IL   \e  fi  kz  fz  \{ 4 !((GI[]n  qB  DR  Tc  et  vE  GU  Wg  iy  {K  M\  !] Ci5R0R&S C]fgj  mJ  hJ  ^K C  [d  eh  jG  eG  [H C  cf C  v  @C  Eb  @b  vc CJ I9%GHXrIst YsDa?a5b luvy  |Y  wY  mZ   js  tw  yV  tV  jW   ru   EN  OR  Tq  Oq  Er 6  ''EGY[ln  BP  Ra  cr  tC  ES  Ue  gw  yI  KZ   [ BYs4P/P%Q B[deh  kG  fG  \H B  Xa  be  gC  bC  XD B  _b B  r{  |  A]  |]  r^ BH G)$EF~t~~VoGpq IcC_>_4` jstw  zV  uV  kW   gp  qt  vR  qR  gS   nq   AJ  KN  Pl  Kl  Am 6 :13DFWYgh
%%
((
8M)CM* M)CM:R M  ) &M^ i~t~~c2333<< 
3=!9 
SVX`S`Ia 
 ~'9;LN_aop'	#|"34 'ylIZ?[ 'ktux  {G  vG  lH 'R ')%
&~t~~h'?
@yl1B'C iX[]iXiNj   {D  EH  JV  EV  {W  2;11>@ 
 !!9;LN_ap  sB  C qy.D)DE qdh q  }A q  W[ q  hk q  ux qf ;I9:>4>>J];^_  i=S8S.T  tx    HL    ]a    il    ux  F %%ACTVgix  {J  K IiW]]@R6S Iclmp  sM  nM  dN I  fo  ps  u|  uB  uB  pB  fC I  [d  eh  jq  jw  jw  ew  [x I  FJ I  `i  jm  oI  jI  `J IV C	"AB>4>>RjCkl YsT[TaTaOaEb r{|  B\  }\  s]   u~  B  DK  DQ  DQ  Q  uR   js  tw  y@  yF  yF  tF  jG   VZ   js  tw  yS  tS  jT $ 2;11>@ 
 !!9;LN_ap  sB  C Iy.D)DE Idh I  }A I  W[ I  hk I  ux IV ;I9:>4>>J];^_  i=S8S.T  tx    HL    ]a    il    ux  F %%ACTVgix  {J  K F38R3R)S Fbklo  rL  mL  cM F  ]f  gj  lF  gF  ]G F  _h  il  nu  n{  n{  i{  _| F  T]  ^a  cj  cp  cp  ^p  Tq F  C F  Yb  cf  hB  cB  YC FP C	"AB>4>>RjCkl 	#GaBa8b qz{~  A[  |[  r\   lu  vy  {U  vU  lV   nw  x{  }D  }J  }J  xJ  nK   cl  mp  ry  r  r  m  c@   OS   cl  mp  rL  mL  cM $ /..OQ 
 37??K Z3(;#;< ZYsTgOgEh Zr{|  BU  }U  sV Z  ^g  hk  m@  h@  ^A Z  MV  WZ  \o  Wo  Mp Z  z Z  _d Z  tw Z  LP Zx 534^T^^DU5VW	#7J2J(K T]^acv^vTw   BK  LO  Qd  Ld  Be   mv  wz  |O  wO  mP   \e  fi  k~  f~  \   JO   in   }@   OS 6 3K22]_ 
 "";7??S Zi5L0L&M ZR[\_ax\xRy Z  CL  MP  Ri  Mi  Cj Z  }F  GJ  Lc  Gc  }d Z  w@  AD  F]  A]  w^ Z  hm Z  BE Z  Z^ Zx =Y;<^T^^La=bc YsD[?[5\ ajkn  qH  lH  bI   R[  \_  ax  \x  Ry   LU  VY  [r  Vr  Ls   FO  PS  Ul  Pl  Fm   x}   LO   ^b . 5k44]_ 
 $$?ASUfhvw #$?wW Z38Q3Q)R ZW`adfa  XA Z  JS  TW  Y`  Yh  Yh  Th  Ji Z  |E  FI  Kd  Fd  |e Z  xA  BE  G`  B`  xa Z  kp Z  EH Z  ]a Zx Ay!?@PhAij 	#G`B`8a fops  vO  qO  gP   Yb  cf  ho  hw  hw  cw  Yx   KT  UX  Zs  Us  Kt   GP  QT  Vo  Qo  Gp   {@   OR   ae 4 5k44]_ 
 $$?ASUfhvw #$?wW _38Q3Q)R _W`adfa  XA _  JS  TW  Y`  Yh  Yh  Th  Ji _  |E  FI  Kd  Fd  |e _  xA  BE  G`  B`  xa _  t}  ~A  C\  ~\  t] _  gl _  AD _  Y] _B Ay!?@PhAij 	#G`B`8a fops  vO  qO  gP   Yb  cf  ho  hw  hw  cw  Yx   KT  UX  Zs  Us  Kt   GP  QT  Vo  Qo  Gp   CL  MP  Rk  Mk  Cl   w|   KN   ]a 4 1+00OQ 
   79KM^`no  7wO Z9S*?%?@ ZSVXmSmIn Z  yB  CF  H]  C]  y^ Z  fo  ps  uJ  pJ  fK Z  W`  ad  f{  a{  W| Z  FK Z  kp Z  @C Z  X\ Zx 9978H[9\] )C9N4N*O Xabeg|b|X}   HQ  RU  Wl  Rl  Hm   u~  B  DY  Y  uZ   fo  ps  uJ  pJ  fK   V[   uz   IL   [_ 8 1+00bd 
   79KM^`no  79KM^_ [9S*?%?@ [SVXmSmIn [  yB  CF  H]  C]  y^ [  fo  ps  uJ  pJ  fK [  W`  ad  f{  a{  W| [  FK [  kp [  @C [  X\ [z 9978H[9\] )C9N4N*O Xabeg|b|X}   HQ  RU  Wl  Rl  Hm   u~  B  DY  Y  uZ   fo  ps  uJ  pJ  fK   V[   uz   IL   [_ : 35GIZ\mo}~ IIc+>&>? I9UXZaZgZgUgKh Ir{|  BU  }U  sV I  ^a I  ux I  HQ  RU  Wj  Rj  Hk IV 534^T^^DT5UV9S:M5M+N ZcdgipivivdvZw   BK  LO  Qd  Ld  Be   mp   DG   W`  ad  fy  ay  Wz .  ''EGXZkm{| Vy6R1R'S V[dehjqjwjwew[x V  EN  OR  T[  Ta  Ta  Oa  Eb V  lu  vy  {W  vW  lX V  `c V  wz V  QU V  kt  ux  zV  uV  kW Vp G)$EF~t~~VqGrs iEa@a6b jstw  zA  zG  zG  uG  kH   T]  ^a  cj  cp  cp  ^p  Tq   {D  EH  Jf  Ef  {g   or   FI   ae   u~  B  D`  `  ua 8 m_oF8)C$89 8IcS^N^D_ 8dg 8  xA  BE  GN  GS  GS  BS  xT 8t 
%#	$^T^^H%=	>33G)H S\]`bm]mSn sv   GP  QT  V]  Vb  Vb  Qb  Gc  /J8Ic7??&:; 8iPSUbPbFc 8hqru  xE  sE  iF 8  V_  `c  el  eq  eq  `q  Vr 8t )9'(
)CD9S'//5I+J U^_bdq_qUr   xA  BE  GT  BT  xU   en  or  t{  t@  t@  o@  eA  3K22z 
 "";=OQbdu  xF  HW  Yh  jy  {I  K[  ]m  o  AP  Q %,-QSegx  {L  N\  &] "x  yH  yH  OS 0y.E)EF 0Uw 0d =Y;<^T^^L_=`a i=T8T.U   fH   m%79JL]_mn
%%
((
<Ayk)* A)CDT:U A  ) &AF 
%#	$^T^^G%<	=!;;DD 
i[(89 
SVXcScId 
 :13DnU
%%
((
,h7cyh' cc c% cQV c_d c  yB  CF  HP  CP  yQ c 8 ) &cJ i~t~~c2333<< iX6 c QV _d lq   BK  LO  QY  LY  BZ 4 ~'9;Ln]B)C$56 BYsT`O`Ea Bqz{~  AM  |M  rN B  ]` B  in B  x} B  FK B  _h  il  nz  iz  _{ BH ')%
&~t~~h'?
@33D)E T]^aco^oTp   AJ  KN  P\  K\  A]   mp   x}   FK   SX   hq  ru  wC  rC  hD 6 )+=?PRcest(3#67 (u (XabegubuXv (T +I)*>4>>*+EF		#~2E(F u dmnq  tB  oB  eC   13EGXZkm{| -y.@)@A -YWZ\nWnMo -w| -  QZ  [^  `r  [r  Qs -^ 3	12>4>>/3RSi=O8O.P \efik}f}\~   HM   ]f  gj  l~  g~  ] " +-?ARTeguv)	#"67 )yQTVeQeGf )V -Y+,^T^^K-HI

yo1E'F 
V_`cet`tVu 
 ~'9;LN_ao  rA  CR  Tc  es  uD  FV  Xg  hbdv|  DH RIc</0 R3 Rru R  MV  WZ  \h  Wh  Mi Rh ')%
&~t~~h'?
@ 9S,->#?  Z]    @C    S\  ]`  bn  ]n  So  F )+=?PR`aGi^ 34 Gs G`c G  |E  FI  KY  FY  |Z GR +I)*>4>>*+EF	YsN/B%C ^a ps   DM  NQ  Sa  Na  Db 8 13EGXZhi !";=OQbdrs M	#/F*F G MV_`ce|`|V} M  FO  PS  Ug  Pg  Fh M  CF M  TW M  ox  y|  ~P  yP  oQ M^ 3	12>4>>/3RSy>U9U/V enor  uL  pL  fM   U^  _b  dv  _v  Uw   RU   dg   w@  AD  FX  AX  wY < !!9;MO`bs  vD  FU  Wf  hw  yG  IY  [k  m}  N  O NYs4J/J%K NZcdgid  [A N  IR  SV  Xn  Sn  Io N  JM N  [^ N  v  @C  E[  @[  v\ N` ;I9:>4>>J^;_` IcCY>Y4Z irsv  yO  tO  jP   Xa  be  g}  b}  X~   Y\   kn   ~G  HK  Mc  Hc  ~d : -/ACTVgiw  zI  KZ  \k  m{  }M  O_  aq  sB  C  HJ  \b  im Wi-=(=> WYWZ\lWlMm Wu~  @C  EU  @U  vV W  qt W  X[ W  r{  |  AQ  |Q  rR Wr /i-.~t~~m/LM"Ys<L7L-M "\efik{f{\| "  EN  OR  Td  Od  Ee "  @C "  eh "  xA  BE  GW  BW  xX "J 57IK\^oq  BQ  Sb  ds  uC  EU  Wg  iy  {J  K M9S2F-F#G MV_`cey`yVz M  CL  MP  Rf  Mf  Cg M  BE M  SV M  mv  wz  |P  wP  mQ M^ 7)56~t~~FX7YZ)CAU<U2V enor  uI  pI  fJ   R[  \_  au  \u  Rv   QT   cf   v  @C  EY  @Y  vZ : !!9;MO`bs  vD  FU  Wf  hw  yG  IY  [k  m}  N  O @i5K0K&L @[deh  kA  fA  \B @  JS  TW  Yo  To  Jp @  yB  CF  HO  HU  HU  CU  yV @  aj  kn  pw  p}  p}  k}  a~ @  IL @  Z] @  t}  ~A  CY  ~Y  tZ @D ;I9:>4>>J_;`a YsDZ?Z5[ jstw  zP  uP  kQ   Yb  cf  h~  c~  Y   HQ  RU  W^  Wd  Wd  Rd  He   py  z}  F  L  L  zL  pM   X[   jm   }F  GJ  Lb  Gb  }c ( (//UWfhw'x $!()IK]_p  sD  FT  Ve  gv  xG  IW  Yi  k{  }M  O^  "_ L)C9W4W*X L`ijm  pN  kN  aO L  Yb  cf  hL  cL  YM L  hk L  DH L  ^g  hk  mK  hK  ^L L\ KI&IJ>4>>ZxKyz 3HfCf9g oxy|  ]  z]  p^   hq  ru  w[  r[  h\   wz   TX   hq  ru  wU  rU  hV @ 13EGXZkm{  ~M  O^  `o  q  AQ  Sc  eu  wF  G ?30B+B!C ?R[\_as\sRt ?  }F  GJ  L^  G^  }_ ?  hq  ru  w~  wD  wD  rD  hE ?  PY  Z]  _f  _l  _l  Zl  Pm ?  x{ ?  IL ?  cl  mp  rD  mD  cE ?B 3	12>4>>BR3ST	#?Q:Q0R ajkn  qC  lC  bD   LU  VY  [m  Vm  Ln   w@  AD  FM  FS  FS  AS  wT   _h  il  nu  n{  n{  i{  _|   GJ   Y\   lu  vy  {M  vM  lN ( $++M`o#p  $%ACUWhj{  ~L  N]  _n  p  AO  Qa  cs  uE  GV  W LYs4N/N%O LW`ad  gA  bA  XB L  LU  VY  [{  V{  L| L  WZ L  sw L  MV  WZ  \v  Wv  Mw L\ C	"AB>4>>RkClm IcC]>]4^ fops  vP  qP  gQ   [d  eh  jJ  eJ  [K   fi   CG   W`  ad  f@  a@  WA > )+=?PRces  vE  GV  Xg  iw  yH  JZ  \k  l;yn!45 ;iW]]HZ>[ ;fopsu|  vC  vC  qC  gD ;  OR ;  `c ;  zC  DG  IW  DW  zX ;z +I)*>4>>++FG	i^0C&D YWZ\c\i\iWiMj u~  @C  EL  ER  ER  @R  vS   ^a   ps   CL  MP  R`  M`  Ca $ 2;11x 
  ''EXgh  !9;MO`bs  vD  FU  Wf  hw  yG  IY  [k  m}  N  O  LS  LY  LY  w|  CG Z	#/E*E F Zad Z  oK Z  rv Zx ;I9:>4>>J^;_` y>T9T/U ps   [   uy > +-?ARTegu  xG  IX  Zi  ky  {K  M]  _o  q@  A7yo!56 79S'--EW;X 7bf 7  }F  GJ  L[  G[  }\ 7r -Y+,^T^^K-HI
i_0D&E )TWY`YfYfTfJg rv   GP  QT  Ve  Qe  Gf   1+00*, 
   79IK[]ln  BR  S Gi-B(BC GPYZ]_f_n_nZnPo G  }F  GJ  LS  L[  L[  G[  }\ G  wz GR 9978HZ9[\ Ys<Q7Q-R _hilnun}n}i}_~   LU  VY  [b  [j  [j  Vj  Lk   FI 4 4J;3I3I/*4, 0
 7>>s  vF  HX  Zi  k|  ~N  7O 38?@w  zJ  L\  ^m  o@  BR  9S 5piEx@x6y p  CL  MP  RY  Ra  Ra  Ma  Cb p  kt  ux  zA  zI  zI  uI  kJ p  OX  Y\  ^Q  YQ  OR p  [d  eh  jq  jy  jy  ey  [z p  CL  MP  RY  Ra  Ra  Ma  Cb p  gp  qt  vi  qi  gj p  s|  }@  BI  BQ  BQ  }Q  sR p  [d  eh  jq  jy  jy  ey  [z p  BK  LO  QD	  LD	  BE	 p  Q	Z	  [	^	  `	g	  `	o	  `	o	  [	o	  Q	p	 p  |	E
  F
I
  K
R
  K
Z
  K
Z
  F
Z
  |	[
 p  d
m
  n
q
  s
f  n
f  d
g p  t}  ~A  CJ  CR  CR  ~R  tS p  `i  jm  ov  o~  o~  j~  ` p  K@ p  TY p  vz pd -kI6i,jkykokyky  {i  lj  -k )Ys  UH  PH  FI   R[  \_  ah  ap  ap  \p  Rq   zC  DG  IP  IX  IX  DX  zY   ^g  hk  m`  h`  ^a   js  tw  y@  yH  yH  tH  jI   R[  \_  ah  ap  ap  \p  Rq   v  @C  Ex  @x  vy   BK  LO  QX  Q`  Q`  L`  Ba   js  tw  y@  yH  yH  tH  jI   QZ  [^  `S	  [S	  QT	   `	i	  j	m	  o	v	  o	~	  o	~	  j	~	  `		   K
T
  U
X
  Z
a
  Z
i
  Z
i
  U
i
  K
j
   s
|
  }
@  Bu  }
u  s
v   CL  MP  RY  Ra  Ra  Ma  Cb   ox  y|  ~E  ~M  ~M  yM  oN   ZO   ch   EI 8 1+00$& 
 !!9;KM]_n  qB  DT  U  !9;KM]_n  qB  DT  U &'EGWYikz  }N  P`   a <i-C(CD <IVY[qVqLr <  @I  JM  OV  O^  O^  J^  @_ <  lu  vy  {B  {J  {J  vJ  lK <  W`  ad  fm  fu  fu  au  Wv <  BK  LO  QX  Q`  Q`  L`  Ba <  mI <| 9978HZ9[\ Ys<R7R-S [deh  kA  fA  \B   OX  Y\  ^e  ^m  ^m  Ym  On   {D  EH  JQ  JY  JY  EY  {Z   fo  ps  u|  uD  uD  pD  fE   QZ  [^  `g  `o  `o  [o  Qp   |X $ 0//*, 
 $$?AQScet  wH  JZ  [ $%ACSUegv  yJ  L\  ] %&CEUWgix  {L  N^  _  jq  jx  jx  DP  W[ `Ic+D&DE `yY\^xYxOy `  GP  QT  V]  Ve  Ve  Qe  Gf `  s|  }@  BI  BQ  BQ  }Q  sR `  `i  jm  ov  o~  o~  j~  ` `  MV  WZ  \c  \k  \k  Wk  Ml `  @C `  Ni `D 7)56~t~~FV7WX 9S:S5S+T  ^ghk  nH  iH  _I    V_  `c  el  et  et  `t  Vu    BK  LO  QX  Q`  Q`  L`  Ba    ox  y|  ~E  ~M  ~M  yM  oN    \e  fi  kr  kz  kz  fz  \{    OR    ^y  D !7 6 6*!, 
 $++MO_aq  tC  EV  Xh  $i  $+,OQacs  vE  GX  Zj  %k !%,-QSceu  xG  IZ  \l  &m " HO  HV  HV  bn  }  FJ ZYs4T/T%U Z_hil  oP  jP  `Q Z  ^g  hk  mt  m|  m|  h|  ^} Z  JS  TW  Y`  Yh  Yh  Th  Ji Z  w@  AD  FM  FU  FU  AU  wV Z  dm  nq  sz  sB  sB  nB  dC Z  WZ Z  eG Zx E#CD^T^^TmEno )IcCc>c4d )nwx{  ~_  y_  o` )  mv  wz  |C  |K  |K  wK  mL )  Yb  cf  ho  hw  hw  cw  Yx )  FO  PS  U\  Ud  Ud  Pd  Fe )  s|  }@  BI  BQ  BQ  }Q  sR )  fi )  uW )V .D[-C-C)*., *
 188giy  |L  N]  _p  rB  1C -189ik{  ~N  P_  ar  tD  2E .29:km}  @P  Ra  ct  vF  3G / ho  hv  hv  B	N	  ]	_	  f	j	 dIcCp>p4q d  |E  FI  Ky  Fy  |z d  GP  QT  V]  Ve  Ve  Qe  Gf d  s|  }@  BI  BQ  BQ  }Q  sR d  `i  jm  ov  o~  o~  j~  ` d  MV  WZ  \c  \k  \k  Wk  Ml d  BK  LO  QX  Q`  Q`  L`  Ba d  w@  AD  FM  FU  FU  AU  wV d  jm d  xg dL '_i0]&^_m_c_m_m  oW  `X  'Y #+9SRM  DA +  KT  UX  ZH  UH  KI +  V_  `c  el  et  et  `t  Vu +  BK  LO  QX  Q`  Q`  L`  Ba +  ox  y|  ~E  ~M  ~M  yM  oN +  \e  fi  kr  kz  kz  fz  \{ +  QZ  [^  `g  `o  `o  [o  Qp +  FO  PS  U\  Ud  Ud  Pd  Fe +  y| +  Hw +Z '=k&<&<"*', #
 *11Y[km}  @O  Qb  dt  *u &*12[]mo  BQ  Sd  fv  +w '+23]_o  rB  DS  Uf  hx  ,y ( JQ  JW  JW  co  ~@	  G	K	 b9S:`5`+a bktux  {b  vb  lc b  py  z}  F  N  N  zN  pO b  \e  fi  kr  kz  kz  fz  \{ b  IR  SV  X_  Xg  Xg  Sg  Ih b  v  @C  EL  ET  ET  @T  vU b  kt  ux  zA  zI  zI  uI  kJ b  `i  jm  ov  o~  o~  j~  ` b  SV b  aI bH  Qy)OPQ_QUQ_Q_`  RA   B +)CIoDo:p +  {D  EH  Jq  Eq  {r +  H  IL  NU  N]  N]  I]  ^ +  kt  ux  zA  zI  zI  uI  kJ +  Xa  be  gn  gv  gv  bv  Xw +  EN  OR  T[  Tc  Tc  Oc  Ed +  zC  DG  IP  IX  IX  DX  zY +  ox  y|  ~E  ~M  ~M  yM  oN +  be +  qY +Z $:;#9#9*$,  
 '..SUegw  zI  K\  ^n  'o #'./UWgiy  |K  M^  `p  (q $(/0WYik{  ~M  O`  br  )s % T[  Tb  Tb  nz  AE W	#7Z2Z([ Wenor  uY  pY  fZ W  gp  qt  v}  vE  vE  qE  gF W  S\  ]`  bi  bq  bq  ]q  Sr W  @I  JM  OV  O^  O^  J^  @_ W  mv  wz  |C  |K  |K  wK  mL W  `c W  nS Wr KI&IJ>4>>ZvKwx !yFiAi7j !t}  B  Dh  h  ui !  v  @C  EL  ET  ET  @T  vU !  bk  lo  qx  q@  q@  l@  bA !  OX  Y\  ^e  ^m  ^m  Ym  On !  |E  FI  KR  KZ  KZ  FZ  |[ !  or !  ~c !F "8!7!7*", 
 %,,OQacs  vE  GX  Zj  %k !%,-QSceu  xG  IZ  \l  &m "&-.SUegw  zI  K\  ^n  'o # sz  sA  sA  MY  hj  qu [i5V0V&W [ajkn  qS  lS  bT [  \e  fi  kr  kz  kz  fz  \{ [  HQ  RU  W^  Wf  Wf  Rf  Hg [  t}  ~A  CJ  CR  CR  ~R  tS [  aj  kn  pw  p  p  k  a@ [  NW  X[  ]d  ]l  ]l  Xl  Nm [  AD [  Or [z G)$EF~t~~VpGqr *YsDe?e5f *pyz}  @b  {b  qc *  kt  ux  zA  zI  zI  uI  kJ *  W`  ad  fm  fu  fu  au  Wv *  CL  MP  RY  Ra  Ra  Ma  Cb *  py  z}  F  N  N  zN  pO *  ]f  gj  ls  l{  l{  g{  ]| *  PS *  _B *X )?(>(>$*), %
 ,33]_o  rB  DS  Uf  hx  ,y (,34_aq  tD  FU  Wh  jz  -{ )-45acs  vF  HW  Yj  l|  .} * QX  Q_  Q_  kw  FH  OS ^y>f9f/g ^qz{~  Aj  |j  rk ^  s|  }@  BI  BQ  BQ  }Q  sR ^  _h  il  nu  n}  n}  i}  _~ ^  KT  UX  Za  Zi  Zi  Ui  Kj ^  xA  BE  GN  GV  GV  BV  xW ^  en  or  t{  tC  tC  oC  eD ^  X[ ^  fP ^@ "U+S!TUcUYUcUc  eH  VI  "J *iMuHu>v *  AJ  KN  Py  Ky  Az *  BK  LO  QX  Q`  Q`  L`  Ba *  nw  x{  }D  }L  }L  xL  nM *  Zc  dg  ip  ix  ix  dx  Zy *  GP  QT  V]  Ve  Ve  Qe  Gf *  t}  ~A  CJ  CR  CR  ~R  tS *  gj *  v` *X 6L[5K5K1*6, 2
 9@@w  zJ  L\  ^m  o@  BR  9S 59@Ay  |L  N^  `o  qB  DT  :U 67>?u  xI  K[  8\ 4:AB{  ~N  P`  bq  sD  FV  ;W 7 V
]
  V
d
  V
d
  p
|
  KM  TX hi  NC  IC  ?D h  NW  X[  ]S  XS  NT h  \e  fi  k_  f_  \` h  mv  wz  |C  |K  |K  wK  mL h  Yb  cf  ho  hw  hw  cw  Yx h  FO  PS  U\  Ud  Ud  Pd  Fe h  s|  }@  BI  BQ  BQ  }Q  sR h  hq  ru  w~  wF  wF  rF  hG h  ]f  gj  ls  l{  l{  g{  ]| h  P	S	 h  ^	U
 hT /oi8m.no}oso}o}  q  pr  /s +,YWZ  ]R  XR  NS ,  ]f  gj  lb  gb  ]c ,  kt  ux  zn  un  ko ,  |E  FI  KR  KZ  KZ  FZ  |[ ,  hq  ru  w~  wF  wF  rF  hG ,  U^  _b  dk  ds  ds  _s  Ut ,  BK  LO  QX  Q`  Q`  L`  Ba ,  w@  AD  FM  FU  FU  AU  wV ,  lu  vy  {B	  {J	  {J	  vJ	  lK	 ,  _	b	 ,  n	e
 ,\ /Ek.D.D**/, +
 299ik{  ~N  P_  ar  tD  2E .29:km}  @P  Ra  ct  vF  3G /078giz  }M  1N -3:;mo  BR  Tc  ev  xH  4I 0 q	x	  q	~	  q	~	  J
V
  e
g
  n
r
 gYsDr?r5s g  ~G  HK  M|  H|  ~} g  EN  OR  TA  OA  EB g  OX  Y\  ^e  ^m  ^m  Ym  On g  {D  EH  JQ  JY  JY  EY  {Z g  hq  ru  w~  wF  wF  rF  hG g  U^  _b  dk  ds  ds  _s  Ut g  JS  TW  Y`  Yh  Yh  Th  Ji g  H  IL  NU  N]  N]  I]  ^ g  ru g  @	p	 gR (ay1_'`aoaeaoao  qZ  b[  (\ $,Ic  TB  OB  EC ,  MV  WZ  \K  WK  ML ,  T]  ^a  cP  ^P  TQ ,  ^g  hk  mt  m|  m|  h|  ^} ,  JS  TW  Y`  Yh  Yh  Th  Ji ,  w@  AD  FM  FU  FU  AU  wV ,  dm  nq  sz  sB  sB  nB  dC ,  Yb  cf  ho  hw  hw  cw  Yx ,  NW  X[  ]d  ]l  ]l  Xl  Nm ,  A	D	 ,  P	@
 ,\ ?Uk>T>T:*?, ;
 BI  JJ  L\  ^n  p  AR  Td  Be >BI  KL  N^  `p  rA  CT  Vf  Cg ?@G  IH  J[  ]m  An =CJ  LN  P`  br  tC  EV  Xh  Di @CJ  LN  P`  br  tC  EV  Xh  Di @ |C  |J  |J  Vb  qs  z~ oSV  YW  TW  JX o  bk  lo  qp  lp  bq o  yB  CF  HE  CE  yF o  S\  ]`  bi  bq  bq  ]q  Sr o  H  IL  NU  N]  N]  I]  ^ o  lu  vy  {B  {J  {J  vJ  lK o  Yb  cf  ho  hw  hw  cw  Yx o  NW  X[  ]d  ]l  ]l  Xl  Nm o  C	L	  M	P	  R	Y	  R	a	  R	a	  M	a	  C	b	 o  m	v	  w	z	  |	|
  w	|
  m	}
 o  LU  VY  [b  [j  [j  Vj  Lk o  zC  DG  IP  IX  IX  DX  zY o  mp o  {{ ob 8AyA  8A  BP  BF  BP  BP  QN  BO  8P 40Xabe  hf  cf  Yg 0  qz  {~  @  {  q@ 0  HQ  RU  WT  RT  HU 0  bk  lo  qx  q@  q@  l@  bA 0  NW  X[  ]d  ]l  ]l  Xl  Nm 0  {D  EH  JQ  JY  JY  EY  {Z 0  hq  ru  w~  wF  wF  rF  hG 0  ]f  gj  ls  l{  l{  g{  ]| 0  R	[	  \	_	  a	h	  a	p	  a	p	  \	p	  R	q	 0  |	E
  F
I
  K
K  F
K  |	L 0  [d  eh  jq  jy  jy  ey  [z 0  IR  SV  X_  Xg  Xg  Sg  Ih 0  | 0  KK 0d ,B;+A+A'*,, (
 /66ceu  xH  JY  [l  n~  / +/67egw  zJ  L[  ]n  p@  0A ,078giy  |L  N]  _p  rB  1C - HO  HV  HV  bn  }  F	J	 `9SBm=m3n `  yB  CF  Ht  Ct  yu `  }F  GJ  LS  L[  L[  G[  }\ `  ir  sv  x  xG  xG  sG  iH `  U^  _b  dk  ds  ds  _s  Ut `  BK  LO  QX  Q`  Q`  L`  Ba `  ox  y|  ~E  ~M  ~M  yM  oN `  Yb  cf  ho  hw  hw  cw  Yx `  LO `  ZG `D %[I.Y$Z[i[_[i[i  kR  \S  %T !+)CQ|L|B} +  HQ  RU  WC  RC  HD +  LU  VY  [b  [j  [j  Vj  Lk +  xA  BE  GN  GV  GV  BV  xW +  dm  nq  sz  sB  sB  nB  dC +  QZ  [^  `g  `o  `o  [o  Qp +  ~G  HK  MT  M\  M\  H\  ~] +  hq  ru  w~  wF  wF  rF  hG +  [^ +  jW +Z 9O8N8N4*9, 5
 <CC}  @P  Rb  ds  uF  HX  <Y 8<CD  BR  Td  fu  wH  JZ  =[ 9:AB{  ~O  Qa  ;b 7=D  FB  DT  Vf  hw  yJ  L\  >] :=D  FB  DT  Vf  hw  yJ  L\  >] : W^  We  We  q}  LN  UY o)C  RJ  MJ  CK o  U^  _b  d]  _]  U^ o  fo  ps  ul  pl  fm o  zC  DG  IP  IX  IX  DX  zY o  fo  ps  u|  uD  uD  pD  fE o  S\  ]`  bi  bq  bq  ]q  Sr o  @I  JM  OV  O^  O^  J^  @_ o  u~  B  DK  DS  DS  S  uT o  js  tw  y@	  yH	  yH	  tH	  jI	 o  T	]	  ^	a	  c	]
  ^	]
  T	^
 o  m
v
  w
z
  |
C  |
K  |
K  w
K  m
L o  [d  eh  jq  jy  jy  ey  [z o  NQ o  \V ob 2u;s1t  vDuy  vD  vD  E{  v|  2} .0QZ[^  aY  \Y  RZ 0  dm  nq  sl  nl  dm 0  u~  B  D{  {  u| 0  IR  SV  X_  Xg  Xg  Sg  Ih 0  u~  B  DK  DS  DS  S  uT 0  bk  lo  qx  q@  q@  l@  bA 0  OX  Y\  ^e  ^m  ^m  Ym  On 0  DM  NQ  SZ  Sb  Sb  Nb  Dc 0  yB	  C	F	  H	O	  H	W	  H	W	  C	W	  yX	 0  c	l	  m	p	  r	l
  m	l
  c	m
 0  |
E  FI  KR  KZ  KZ  FZ  |
[ 0  js  tw  y@  yH  yH  tH  jI 0  ]` 0  lf 0d #9+"8"8*#, 
 &--QSceu  xG  IZ  \l  &m "&-.SUegw  zI  K\  ^n  'o #'./UWgiy  |K  M^  `p  (q $ OV  O]  O]  iu  |@ Wi5W0W&X Wbklo  rU  mU  cV W  cl  mp  ry  rA  rA  mA  cB W  OX  Y\  ^e  ^m  ^m  Ym  On W  |E  FI  KR  KZ  KZ  FZ  |[ W  ir  sv  x  xG  xG  sG  iH W  \_ W  jN Wr I9%GHXrIst !YsDf?f5g !qz{~  Ad  |d  re !  r{  |  AH  AP  AP  |P  rQ !  ^g  hk  mt  m|  m|  h|  ^} !  KT  UX  Za  Zi  Zi  Ui  Kj !  xA  BE  GN  GV  GV  BV  xW !  kn !  z^ !F +A+*@*@&*+, '
 .55acs  vF  HW  Yj  l|  .} *.56ceu  xH  JY  [l  n~  / +/67egw  zJ  L[  ]n  p@  0A , X_  Xf  Xf  r~  EI Z	#?i:i0j Zt}  B  Do  o  up Z  xA  BE  GN  GV  GV  BV  xW Z  dm  nq  sz  sB  sB  nB  dC Z  PY  Z]  _f  _n  _n  Zn  Po Z  }F  GJ  LS  L[  L[  G[  }\ Z  js  tw  y@  yH  yH  tH  jI Z  ]` Z  kW Zx $Y9-W#XYgY]YgYg  iM  ZN  $O  "yNxIx?y "  DM  NQ  S~  N~  D "  GP  QT  V]  Ve  Ve  Qe  Gf "  s|  }@  BI  BQ  BQ  }Q  sR "  _h  il  nu  n}  n}  i}  _~ "  LU  VY  [b  [j  [j  Vj  Lk "  yB  CF  HO  HW  HW  CW  yX "  lo "  {g "H 2H1G1G-*2, .
 5<<o  rB  DT  Ve  gx  zJ  5K 15<=q  tD  FV  Xg  iz  |L  6M 26=>s  vF  HX  Zi  k|  ~N  7O 3 v}  vD  vD  P\  km  tx h3HyCy9z h  EN  OR  TF  OF  EG h  OX  Y\  ^e  ^m  ^m  Ym  On h  {D  EH  JQ  JY  JY  EY  {Z h  gp  qt  v}  vE  vE  qE  gF h  T]  ^a  cj  cr  cr  ^r  Ts h  AJ  KN  PW  P_  P_  K_  A` h  tw h  Bu hT +g)4e*fgugkgugu  wd  he  +f '*	RU  XI  SI  IJ *  T]  ^a  cU  ^U  TV *  ^g  hk  mt  m|  m|  h|  ^} *  JS  TW  Y`  Yh  Yh  Th  Ji *  v  @C  EL  ET  ET  @T  vU *  cl  mp  ry  rA  rA  mA  cB *  PY  Z]  _f  _n  _n  Zn  Po *  CF *  RE *X ?Uk>T>T:*?, ;
 BI  JJ  L\  ^n  p  AR  Td  Be >BI  KL  N^  `p  rA  CT  Vf  Cg ?@G  IH  J[  ]m  An =CJ  LN  P`  br  tC  EV  Xh  Di @ DK  DR  DR  ^j  y{  BF s	RU  XV  SV  IW s  aj  kn  po  ko  ap s  xA  BE  GD  BD  xE s  R[  \_  ah  ap  ap  \p  Rq s  ~G  HK  MT  M\  M\  H\  ~] s  kt  ux  zA  zI  zI  uI  kJ s  Xa  be  gn  gv  gv  bv  Xw s  MV  WZ  \c  \k  \k  Wk  Ml s  B	K	  L	O	  Q	X	  Q	`	  Q	`	  L	`	  B	a	 s  u	x	 s  C
C sj 8AyA  8A  BP  BF  BP  BP  QM  BN  8O 4,W`ad  ge  be  Xf ,  py  z}  ~  z~  p ,  GP  QT  VS  QS  GT ,  aj  kn  pw  p  p  k  a@ ,  MV  WZ  \c  \k  \k  Wk  Ml ,  zC  DG  IP  IX  IX  DX  zY ,  gp  qt  v}  vE  vE  qE  gF ,  \e  fi  kr  kz  kz  fz  \{ ,  Q	Z	  [	^	  `	g	  `	o	  `	o	  [	o	  Q	p	 ,  D
G
 ,  S
S ,\ "8!7!7!"# 
 !((GIY[km|  P  Rb  !c  '(GIY[km|  P  Rb  !c #*+MO`br#s  %,-QSceu  xG  IZ  \l  &m " HO  HV  HV  in  AF  ]h  os _9S2O-O#P _U^_b  eB  `B  VC _  KT  UX  Zz  Uz  K{ _  DM  NQ  SZ  Sb  Sb  Nb  Dc _  lu  vy  {B  {J  {J  vJ  lK _  T]  ^a  cj  cr  cr  ^r  Ts _  |E  FI  KR  KZ  KZ  FZ  |[ _  eG _  dh _  |@ _  Y\ _B G)$EF~t~~VqGrs )CA^<^2_ dmnq  tQ  oQ  eR   Zc  dg  iI  dI  ZJ   S\  ]`  bi  bq  bq  ]q  Sr   {D  EH  JQ  JY  JY  EY  {Z   cl  mp  ry  rA  rA  mA  cB   KT  UX  Za  Zi  Zi  Ui  Kj   uW   fj   y}   QT D .55acs  vF  HW  Yj  l|  .} *-45acs  vF  HW  Yj  l|  .} *078giz  }M  1N -29:ksz  tC  tC  3D /N)CAk<k2l Nqz{~  Ak  |k  rl N  t}  ~A  Cp  ~p  tq N  zC  DG  IP  IX  IX  DX  zY N  bk  lo  qx  q@  q@  l@  bA N  JS  TW  Y`  Yh  Yh  Th  Ji N  r{  |  AH  AP  AP  |P  rQ N  gp  qt  v}  vE  vE  qE  gF N  \e  fi  kr  kz  kz  fz  \{ N  Fu N  C	G	 N  [	_	 N  x	{	 N  W
`
  a
d
  f
U  a
U  W
V N` (ay1_'`aoaeaoao  q[  b\  (] $3PzKzA{   AJ  KN  Pz  Kz  A{   CL  MP  R  M  C@   IR  SV  X_  Xg  Xg  Sg  Ih   qz  {~  @G  @O  @O  {O  qP   Yb  cf  ho  hw  hw  cw  Yx   AJ  KN  PW  P_  P_  K_  A`   v  @C  EL  ET  ET  @T  vU   kt  ux  zA  zI  zI  uI  kJ   UD	   S	W	   f	j	   ~	A
   Q
Z
  [
^
  `
O  [
O  Q
P B )?(>(>$!)# %
 (//UWgiy  |K  M^  `p  (q $'./UWgiy  |K  M^  `p  (q $,34_aq  tD  FU  Wh  jz  -{ ) U\  Uc  Uc  v{  NS  ju  |@ `Ic;_6_,` `enor  uY  pY  fZ `  bk  lo  qx  q@  q@  l@  bA `  JS  TW  Y`  Yh  Yh  Th  Ji `  r{  |  AH  AP  AP  |P  rQ `  Zc  dg  ip  ix  ix  dx  Zy `  BK  LO  QX  Q`  Q`  L`  Ba `  kT `  qu `  IM `  fi `D "U+S!TUcUYUcUc  eI  VJ  "K 9SJnEn;o t}  B  Dh  h  ui   qz  {~  @G  @O  @O  {O  qP   Yb  cf  ho  hw  hw  cw  Yx   AJ  KN  PW  P_  P_  K_  A`   ir  sv  x  xG  xG  sG  iH   QZ  [^  `g  `o  `o  [o  Qp   {d   sw   FJ   ^a B 6L[5K5K1!6# 2
 5<<o  rB  DT  Ve  gx  zJ  5K 14;<o  rB  DT  Ve  gx  zJ  5K 17>?u  xI  K[  8\ 49@Ay  |L  N^  `o  qB  DT  :U 6 Z	a	  Z	h	  Z	h	  {	@
  S
X
  o
z
  AE l9SJ{E{;| l  BK  LO  QB  LB  BC l  KT  UX  ZN  UN  KO l  Xa  be  gn  gv  gv  bv  Xw l  @I  JM  OV  O^  O^  J^  @_ l  hq  ru  w~  wF  wF  rF  hG l  PY  Z]  _f  _n  _n  Zn  Po l  EN  OR  T[  Tc  Tc  Oc  Ed l  zC  DG  IP  IX  IX  DX  zY l  cY	 l  v	z	 l  N
R
 l  k
n
 l\ /oi8m.no}oso}o}  r  ps  /t +!)TW  ZK  UK  KL !  QZ  [^  `Q  [Q  QR !  Zc  dg  i]  d]  Z^ !  gp  qt  v}  vE  vE  qE  gF !  OX  Y\  ^e  ^m  ^m  Ym  On !  w@  AD  FM  FU  FU  AU  wV !  _h  il  nu  n}  n}  i}  _~ !  T]  ^a  cj  cr  cr  ^r  Ts !  IR  SV  X_  Xg  Xg  Sg  Ih !  si	 !  x	|	 !  K
O
 !  c
f
 !F /Ek.D.D*!/# +
 .55acs  vF  HW  Yj  l|  .} *-45acs  vF  HW  Yj  l|  .} *078giz  }M  1N -29:km}  @P  Ra  ct  vF  3G / u|  uC	  uC	  V	[	  n	s	  J
U
  \
`
 U)CAk<k2l Uqz{~  Ak  |k  rl U  t}  ~A  Cp  ~p  tq U  zC  DG  IP  IX  IX  DX  zY U  bk  lo  qx  q@  q@  l@  bA U  JS  TW  Y`  Yh  Yh  Th  Ji U  r{  |  AH  AP  AP  |P  rQ U  gp  qt  v}  vE  vE  qE  gF U  \e  fi  kr  kz  kz  fz  \{ U  Et U  Q	U	 U  i	m	 U  F
I
 Un (ay1_'`aoaeaoao  q[  b\  (] $!3PzKzA{ !  AJ  KN  Pz  Kz  A{ !  CL  MP  R  M  C@ !  IR  SV  X_  Xg  Xg  Sg  Ih !  qz  {~  @G  @O  @O  {O  qP !  Yb  cf  ho  hw  hw  cw  Yx !  AJ  KN  PW  P_  P_  K_  A` !  v  @C  EL  ET  ET  @T  vU !  kt  ux  zA  zI  zI  uI  kJ !  UD	 !  S	W	 !  f	j	 !  ~	A
 !F 1+00*, 
   79IK[]ln  BR  S Gi-B(BC GPYZ]_f_n_nZnPo G  }F  GJ  LS  L[  L[  G[  }\ G  wz GR 9978HZ9[\ Ys<Q7Q-R _hilnun}n}i}_~   LU  VY  [b  [j  [j  Vj  Lk   FI 4 .{--9; 
 "";=MO_ap  sD  FV  W #$?AQScet  wH  JZ  [  HO  HV  HV  ]a 6Ys,C'CD 6T]^acjcrcr^rTs 6  DM  NQ  SZ  Sb  Sb  Nb  Dc 6  nG 6p 3	12>4>>.3QRIc;R6R,S clmpry  sB  sB  nB  dC   S\  ]`  bi  bq  bq  ]q  Sr   ~W " /..9; 
 ##=?OQacr  uF  HX  Y $%ACSUegv  yJ  L\  ]  KR  KY  KY  `d 6i-E(EF 6V_`celetet`tVu 6  FO  PS  U\  Ud  Ud  Pd  Fe 6  pJ 6p 534^T^^O5TUYs<T7T-U enort{  uD  uD  pD  fE   U^  _b  dk  ds  ds  _s  Ut   @Z " /..9; 
 ##=?OQacr  uF  HX  Y $%ACSUegv  yJ  L\  ]  x  xF  xF  MQ 8y.F)FG 8T]^acjcrcr^rTs 8  DM  NQ  SZ  Sb  Sb  Nb  Dc 8  s|  }@  BI  BQ  BQ  }Q  sR 8  ]w 8t 534^T^^DT5UVi=U8U.V clmpry  sB  sB  nB  dC   S\  ]`  bi  bq  bq  ]q  Sr   BK  LO  QX  Q`  Q`  L`  Ba   mG & K!35FHY[ikz  }L  N]  _m  o~  @P  Rb  dt  vE  F	
%%
((
9A9S)^, AIc9n<U A  ) &AF !y !5655>> 
)CN"; 
9UXZcUcKd 
 \#57HJ[]km|  N  P_  ao  qA  CS  Ue  gv  w
$Ic:o. $iZ>X $L 	#	/">4>>%#89
9S*_#= 
YWZ\fWfMg 
 )+=?PRces  vE  GV  Xg  iw  yI  K[  ]m  o~  ()C$78 (IcSaNaDb (r{|  BP  }P  sQ (T +I)*>4>>*+EF	33F)G S\]`bp]pSq   BK  LO  Q_  L_  B`  );=NPacq  tC  ET  Ve  gu  wG  IY  [k  m|  }(3#56 ()CQ^L^B_ (oxy|  L  zL  pM (T )9'(	)BC	#}2D(E QZ[^`m[mQn   H  IL  N[  I[  \  K!35FHY[ij	
%%
((
9D9S)^, DIc9n<U D  ) &DL !y !5655>> 
)CN"; 
9UXZcUcKd 
 );=NPacqr'3#56 '3P]K]A^ 'nwx{  ~K  yK  oL 'R )9'(	)BC	#}2D(E PYZ]_lZlPm   ~G  HK  MZ  HZ  ~[  ~'9;LN_aop)Ic</0 )	#|J[@\ )V ')%
&~t~~g'>
?
9S,->#? 
yY\^jYjOk 
 (>{'='=#Z( $
 &--QSegx  {L  N\  &] "0	#?a:a0b 0luvy  |^  w^  m_ 0d !S	*Q RSaSWSaSa  cD  TE  !F yNpIp?q   |E  FI  Km  Fm  |n  );=NPacqr$ym!34 $IcS`N`Da $L )9'()AB
i]0B&C 
S\]`bo]oSp 
 /1CEVXikyz 'Ys,='=> ')TWYjTjJk '  |E  FI  K\  F\  |] 'R 1y/01NOIc;L6L,M YbcfhycyYz   KT  UX  Zk  Uk  Kl  );=NPacqr
%%
((
=/*<ym!34 <IcS`N`Da < + ) &<| )9'()AB#==FF 
i]0B&C 
S\]`bo]oSp 
 /1CEVXikyz 'Ys,='=> ')TWYjTjJk '  |E  FI  K\  F\  |] 'R 1y/01NOIc;L6L,M YbcfhycyYz   KT  UX  Zk  Uk  Kl  .D[-C-C)Z. *
 ,33]_q  tE  GX  Zh  ,i (189ikz  }L  2M .5yFnAn7o 5  zC  DG  Iw  Dw  zx 5n '_i0]&^_m_c_m_m  oW  `X  'Y #iPSU}P}F~   IR  SV  XF  SF  IG  %k$$
y
 K!35FHY[ikz  }L  N]  _m  o  AQ  Sc  et  u	A3	>* As A4 AF !y !67	#y. 9 c 4   '&&y
 m%79JL]_mo~  AP  Ra  cq  sC  EU  Wg  ix  y~Y5Yhi ]a  DK  DQ  DQ  X\ E9S+-. E9S,=N3O EX\ E  oC EN 
%#	$^T^^G%<	=)C,<"= )CQ]L]B^ hl   {O r\   