import{S as kd,i as Ad,s as Bd,e as o,k as p,w,t as l,M as Pd,c as a,d as s,m,a as n,x as v,h as i,b as d,N as zd,G as e,g as _,y as T,q as $,o as M,B as N,v as Vd,L as ss}from"../../chunks/vendor-hf-doc-builder.js";import{T as Zs}from"../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../chunks/Docstring-hf-doc-builder.js";import{C as os}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as L}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ts}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Gd}from"../../chunks/PipelineTag-hf-doc-builder.js";function Xd(R){let c,b,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFJlc05ldENvbmZpZyUyQyUyMFJlc05ldE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFJlc05ldCUyMHJlc25ldC01MCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBSZXNOZXRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwcmVzbmV0LTUwJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBSZXNOZXRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ResNetConfig, ResNetModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ResNet resnet-50 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ResNetConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the resnet-50 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ResNetModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){c=o("p"),b=l("Example:"),g=p(),w(u.$$.fragment)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Example:"),f.forEach(s),g=m(r),v(u.$$.fragment,r)},m(r,f){_(r,c,f),e(c,b),_(r,g,f),T(u,r,f),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function Qd(R){let c,b,g,u,y;return{c(){c=o("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),y=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(f,"CODE",{});var F=n(g);u=i(F,"Module"),F.forEach(s),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(s)},m(r,f){_(r,c,f),e(c,b),e(c,g),e(g,u),e(c,y)},d(r){r&&s(c)}}}function Sd(R){let c,b,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFJlc05ldE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBbW9kZWwlMjAlM0QlMjBSZXNOZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGcmVzbmV0LTUwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ResNetModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ResNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2048</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){c=o("p"),b=l("Example:"),g=p(),w(u.$$.fragment)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Example:"),f.forEach(s),g=m(r),v(u.$$.fragment,r)},m(r,f){_(r,c,f),e(c,b),_(r,g,f),T(u,r,f),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function Yd(R){let c,b,g,u,y;return{c(){c=o("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),y=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(f,"CODE",{});var F=n(g);u=i(F,"Module"),F.forEach(s),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(s)},m(r,f){_(r,c,f),e(c,b),e(c,g),e(g,u),e(c,y)},d(r){r&&s(c)}}}function qd(R){let c,b,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFJlc05ldEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnJlc25ldC01MCUyMiklMEFtb2RlbCUyMCUzRCUyMFJlc05ldEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnJlc25ldC01MCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ResNetForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ResNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tiger cat`}}),{c(){c=o("p"),b=l("Example:"),g=p(),w(u.$$.fragment)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Example:"),f.forEach(s),g=m(r),v(u.$$.fragment,r)},m(r,f){_(r,c,f),e(c,b),_(r,g,f),T(u,r,f),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function Hd(R){let c,b,g,u,y;return{c(){c=o("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),y=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(f,"CODE",{});var F=n(g);u=i(F,"Module"),F.forEach(s),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(s)},m(r,f){_(r,c,f),e(c,b),e(c,g),e(g,u),e(c,y)},d(r){r&&s(c)}}}function Ld(R){let c,b,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGUmVzTmV0TW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlJlc05ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFResNetModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFResNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2048</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){c=o("p"),b=l("Example:"),g=p(),w(u.$$.fragment)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Example:"),f.forEach(s),g=m(r),v(u.$$.fragment,r)},m(r,f){_(r,c,f),e(c,b),_(r,g,f),T(u,r,f),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function Od(R){let c,b,g,u,y;return{c(){c=o("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),y=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(f,"CODE",{});var F=n(g);u=i(F,"Module"),F.forEach(s),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(s)},m(r,f){_(r,c,f),e(c,b),e(c,g),e(g,u),e(c,y)},d(r){r&&s(c)}}}function Dd(R){let c,b,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGUmVzTmV0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGcmVzbmV0LTUwJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZSZXNOZXRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGludCh0Zi5tYXRoLmFyZ21heChsb2dpdHMlMkMlMjBheGlzJTNELTEpKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFResNetForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFResNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tiger cat`}}),{c(){c=o("p"),b=l("Example:"),g=p(),w(u.$$.fragment)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Example:"),f.forEach(s),g=m(r),v(u.$$.fragment,r)},m(r,f){_(r,c,f),e(c,b),_(r,g,f),T(u,r,f),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function Kd(R){let c,b,g,u,y;return{c(){c=o("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),y=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(f,"CODE",{});var F=n(g);u=i(F,"Module"),F.forEach(s),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(s)},m(r,f){_(r,c,f),e(c,b),e(c,g),e(g,u),e(c,y)},d(r){r&&s(c)}}}function ec(R){let c,b,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXhSZXNOZXRNb2RlbCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGcmVzbmV0LTUwJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheFJlc05ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, FlaxResNetModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxResNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){c=o("p"),b=l("Examples:"),g=p(),w(u.$$.fragment)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Examples:"),f.forEach(s),g=m(r),v(u.$$.fragment,r)},m(r,f){_(r,c,f),e(c,b),_(r,g,f),T(u,r,f),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function tc(R){let c,b,g,u,y;return{c(){c=o("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),y=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(f,"CODE",{});var F=n(g);u=i(F,"Module"),F.forEach(s),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(s)},m(r,f){_(r,c,f),e(c,b),e(c,g),e(g,u),e(c,y)},d(r){r&&s(c)}}}function sc(R){let c,b,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXhSZXNOZXRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4UmVzTmV0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGcmVzbmV0LTUwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9jbGFzc19pZHglMjAlM0QlMjBqYXgubnVtcHkuYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklMEFwcmludCglMjJQcmVkaWN0ZWQlMjBjbGFzcyUzQSUyMiUyQyUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZHguaXRlbSgpJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, FlaxResNetForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxResNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = jax.numpy.argmax(logits, axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx.item()])`}}),{c(){c=o("p"),b=l("Example:"),g=p(),w(u.$$.fragment)},l(r){c=a(r,"P",{});var f=n(c);b=i(f,"Example:"),f.forEach(s),g=m(r),v(u.$$.fragment,r)},m(r,f){_(r,c,f),e(c,b),_(r,g,f),T(u,r,f),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function oc(R){let c,b,g,u,y,r,f,F,Ca,Wo,O,he,Us,Le,Ea,Ws,xa,ko,I,Za,Oe,Ua,Wa,De,ka,Aa,ks,Ba,Pa,As,za,Va,Bs,Ga,Xa,Ao,as,Qa,Bo,ns,Sa,Po,rs,Ps,Ya,zo,ls,qa,Vo,is,Ke,Ha,ds,La,Oa,Go,ue,Da,et,Ka,en,Xo,tt,si,Qo,A,tn,st,sn,on,ot,an,nn,at,rn,ln,So,D,ge,zs,nt,dn,Vs,cn,Yo,cs,pn,qo,rt,Ho,_e,H,ps,mn,fn,lt,hn,un,it,gn,_n,yn,ms,bn,fs,wn,Lo,hs,vn,Oo,K,ye,Gs,dt,Tn,Xs,$n,Do,Z,ct,Mn,ee,Nn,us,Rn,Fn,pt,jn,Jn,In,te,Cn,gs,En,xn,_s,Zn,Un,Wn,be,Ko,se,we,Qs,mt,kn,Ss,An,ea,Q,ft,Bn,ht,Pn,ut,zn,Vn,Gn,B,gt,Xn,oe,Qn,ys,Sn,Yn,Ys,qn,Hn,Ln,ve,On,Te,ta,ae,$e,qs,_t,Dn,Hs,Kn,sa,U,yt,er,Ls,tr,sr,bt,or,wt,ar,nr,rr,P,vt,lr,ne,ir,bs,dr,cr,Os,pr,mr,fr,Me,hr,Ne,oa,re,Re,Ds,Tt,ur,Ks,gr,aa,S,$t,_r,Mt,yr,Nt,br,wr,vr,z,Rt,Tr,le,$r,ws,Mr,Nr,eo,Rr,Fr,jr,Fe,Jr,je,na,ie,Je,to,Ft,Ir,so,Cr,ra,W,jt,Er,oo,xr,Zr,Jt,Ur,It,Wr,kr,Ar,V,Ct,Br,de,Pr,vs,zr,Vr,ao,Gr,Xr,Qr,Ie,Sr,Ce,la,ce,Ee,no,Et,Yr,ro,qr,ia,j,xt,Hr,lo,Lr,Or,Zt,Dr,Ts,Kr,el,tl,Ut,sl,Wt,ol,al,nl,io,rl,ll,Y,co,kt,il,dl,po,At,cl,pl,mo,Bt,ml,fl,fo,Pt,hl,ul,G,zt,gl,pe,_l,ho,yl,bl,uo,wl,vl,Tl,xe,$l,Ze,da,me,Ue,go,Vt,Ml,_o,Nl,ca,J,Gt,Rl,yo,Fl,jl,Xt,Jl,$s,Il,Cl,El,Qt,xl,St,Zl,Ul,Wl,bo,kl,Al,q,wo,Yt,Bl,Pl,vo,qt,zl,Vl,To,Ht,Gl,Xl,$o,Lt,Ql,Sl,X,Ot,Yl,fe,ql,Mo,Hl,Ll,No,Ol,Dl,Kl,We,ei,ke,pa;return r=new L({}),Le=new L({}),nt=new L({}),rt=new Gd({props:{pipeline:"image-classification"}}),dt=new L({}),ct=new k({props:{name:"class transformers.ResNetConfig",anchor:"transformers.ResNetConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"embedding_size",val:" = 64"},{name:"hidden_sizes",val:" = [256, 512, 1024, 2048]"},{name:"depths",val:" = [3, 4, 6, 3]"},{name:"layer_type",val:" = 'bottleneck'"},{name:"hidden_act",val:" = 'relu'"},{name:"downsample_in_first_stage",val:" = False"},{name:"out_features",val:" = None"},{name:"out_indices",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ResNetConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.ResNetConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality (hidden size) for the embedding layer.`,name:"embedding_size"},{anchor:"transformers.ResNetConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[256, 512, 1024, 2048]</code>) &#x2014;
Dimensionality (hidden size) at each stage.`,name:"hidden_sizes"},{anchor:"transformers.ResNetConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 4, 6, 3]</code>) &#x2014;
Depth (number of layers) for each stage.`,name:"depths"},{anchor:"transformers.ResNetConfig.layer_type",description:`<strong>layer_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;bottleneck&quot;</code>) &#x2014;
The layer to use, it can be either <code>&quot;basic&quot;</code> (used for smaller models, like resnet-18 or resnet-34) or
<code>&quot;bottleneck&quot;</code> (used for larger models like resnet-50 and above).`,name:"layer_type"},{anchor:"transformers.ResNetConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
The non-linear activation function in each block. If string, <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code>
are supported.`,name:"hidden_act"},{anchor:"transformers.ResNetConfig.downsample_in_first_stage",description:`<strong>downsample_in_first_stage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, the first stage will downsample the inputs using a <code>stride</code> of 2.`,name:"downsample_in_first_stage"},{anchor:"transformers.ResNetConfig.out_features",description:`<strong>out_features</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of features to output. Can be any of <code>&quot;stem&quot;</code>, <code>&quot;stage1&quot;</code>, <code>&quot;stage2&quot;</code>, etc.
(depending on how many stages the model has). If unset and <code>out_indices</code> is set, will default to the
corresponding stages. If unset and <code>out_indices</code> is unset, will default to the last stage.`,name:"out_features"},{anchor:"transformers.ResNetConfig.out_indices",description:`<strong>out_indices</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of indices of features to output. Can be any of 0, 1, 2, etc. (depending on how
many stages the model has). If unset and <code>out_features</code> is set, will default to the corresponding stages.
If unset and <code>out_features</code> is unset, will default to the last stage.`,name:"out_indices"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/configuration_resnet.py#L35"}}),be=new ts({props:{anchor:"transformers.ResNetConfig.example",$$slots:{default:[Xd]},$$scope:{ctx:R}}}),mt=new L({}),ft=new k({props:{name:"class transformers.ResNetModel",anchor:"transformers.ResNetModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ResNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_resnet.py#L303"}}),gt=new k({props:{name:"forward",anchor:"transformers.ResNetModel.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ResNetModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ResNetModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ResNetModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_resnet.py#L313",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state after a pooling operation on the spatial dimensions.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new Zs({props:{$$slots:{default:[Qd]},$$scope:{ctx:R}}}),Te=new ts({props:{anchor:"transformers.ResNetModel.forward.example",$$slots:{default:[Sd]},$$scope:{ctx:R}}}),_t=new L({}),yt=new k({props:{name:"class transformers.ResNetForImageClassification",anchor:"transformers.ResNetForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ResNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_resnet.py#L356"}}),vt=new k({props:{name:"forward",anchor:"transformers.ResNetForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ResNetForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ResNetForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ResNetForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ResNetForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_resnet.py#L369",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Me=new Zs({props:{$$slots:{default:[Yd]},$$scope:{ctx:R}}}),Ne=new ts({props:{anchor:"transformers.ResNetForImageClassification.forward.example",$$slots:{default:[qd]},$$scope:{ctx:R}}}),Tt=new L({}),$t=new k({props:{name:"class transformers.TFResNetModel",anchor:"transformers.TFResNetModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFResNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_tf_resnet.py#L372"}}),Rt=new k({props:{name:"call",anchor:"transformers.TFResNetModel.call",parameters:[{name:"pixel_values",val:": Tensor"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFResNetModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFResNetModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFResNetModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_tf_resnet.py#L377",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndNoAttention</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state after a pooling operation on the spatial dimensions.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Fe=new Zs({props:{$$slots:{default:[Hd]},$$scope:{ctx:R}}}),je=new ts({props:{anchor:"transformers.TFResNetModel.call.example",$$slots:{default:[Ld]},$$scope:{ctx:R}}}),Ft=new L({}),jt=new k({props:{name:"class transformers.TFResNetForImageClassification",anchor:"transformers.TFResNetForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFResNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_tf_resnet.py#L414"}}),Ct=new k({props:{name:"call",anchor:"transformers.TFResNetForImageClassification.call",parameters:[{name:"pixel_values",val:": Tensor = None"},{name:"labels",val:": Tensor = None"},{name:"output_hidden_states",val:": bool = None"},{name:"return_dict",val:": bool = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFResNetForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFResNetForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFResNetForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFResNetForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_tf_resnet.py#L431",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also called
feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Ie=new Zs({props:{$$slots:{default:[Od]},$$scope:{ctx:R}}}),Ce=new ts({props:{anchor:"transformers.TFResNetForImageClassification.call.example",$$slots:{default:[Dd]},$$scope:{ctx:R}}}),Et=new L({}),xt=new k({props:{name:"class transformers.FlaxResNetModel",anchor:"transformers.FlaxResNetModel",parameters:[{name:"config",val:": ResNetConfig"},{name:"input_shape",val:" = (1, 224, 224, 3)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxResNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxResNetModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_flax_resnet.py#L580"}}),zt=new k({props:{name:"__call__",anchor:"transformers.FlaxResNetModel.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"train",val:": bool = False"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_flax_resnet.py#L488",returnDescription:`
<p>A <code>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.resnet.configuration_resnet.ResNetConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</li>
<li><strong>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state after a pooling operation on the spatial dimensions.</li>
<li><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings, if the model has an embedding layer, + one
for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states of the
model at the output of each layer plus the optional initial embedding outputs.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new Zs({props:{$$slots:{default:[Kd]},$$scope:{ctx:R}}}),Ze=new ts({props:{anchor:"transformers.FlaxResNetModel.__call__.example",$$slots:{default:[ec]},$$scope:{ctx:R}}}),Vt=new L({}),Gt=new k({props:{name:"class transformers.FlaxResNetForImageClassification",anchor:"transformers.FlaxResNetForImageClassification",parameters:[{name:"config",val:": ResNetConfig"},{name:"input_shape",val:" = (1, 224, 224, 3)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxResNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxResNetForImageClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_flax_resnet.py#L667"}}),Ot=new k({props:{name:"__call__",anchor:"transformers.FlaxResNetForImageClassification.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"train",val:": bool = False"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/resnet/modeling_flax_resnet.py#L488",returnDescription:`
<p>A <code>transformers.modeling_flax_outputs.FlaxImageClassifierOutputWithNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.resnet.configuration_resnet.ResNetConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when</li>
<li><strong><code>config.output_hidden_states=True</code>):</strong>
Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings, if the model has an embedding layer, + one
for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_flax_outputs.FlaxImageClassifierOutputWithNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),We=new Zs({props:{$$slots:{default:[tc]},$$scope:{ctx:R}}}),ke=new ts({props:{anchor:"transformers.FlaxResNetForImageClassification.__call__.example",$$slots:{default:[sc]},$$scope:{ctx:R}}}),{c(){c=o("meta"),b=p(),g=o("h1"),u=o("a"),y=o("span"),w(r.$$.fragment),f=p(),F=o("span"),Ca=l("ResNet"),Wo=p(),O=o("h2"),he=o("a"),Us=o("span"),w(Le.$$.fragment),Ea=p(),Ws=o("span"),xa=l("Overview"),ko=p(),I=o("p"),Za=l("The ResNet model was proposed in "),Oe=o("a"),Ua=l("Deep Residual Learning for Image Recognition"),Wa=l(" by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun. Our implementation follows the small changes made by "),De=o("a"),ka=l("Nvidia"),Aa=l(", we apply the "),ks=o("code"),Ba=l("stride=2"),Pa=l(" for downsampling in bottleneck\u2019s "),As=o("code"),za=l("3x3"),Va=l(" conv and not in the first "),Bs=o("code"),Ga=l("1x1"),Xa=l(". This is generally known as \u201CResNet v1.5\u201D."),Ao=p(),as=o("p"),Qa=l("ResNet introduced residual connections, they allow to train networks with an unseen number of layers (up to 1000). ResNet won the 2015 ILSVRC & COCO competition, one important milestone in deep computer vision."),Bo=p(),ns=o("p"),Sa=l("The abstract from the paper is the following:"),Po=p(),rs=o("p"),Ps=o("em"),Ya=l(`Deeper neural networks are more difficult to train. We present a residual learning framework to ease the training of networks that are substantially deeper than those used previously. We explicitly reformulate the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. We provide comprehensive empirical evidence showing that these residual networks are easier to optimize, and can gain accuracy from considerably increased depth. On the ImageNet dataset we evaluate residual nets with a depth of up to 152 layers---8x deeper than VGG nets but still having lower complexity. An ensemble of these residual nets achieves 3.57% error on the ImageNet test set. This result won the 1st place on the ILSVRC 2015 classification task. We also present analysis on CIFAR-10 with 100 and 1000 layers.
The depth of representations is of central importance for many visual recognition tasks. Solely due to our extremely deep representations, we obtain a 28% relative improvement on the COCO object detection dataset. Deep residual nets are foundations of our submissions to ILSVRC & COCO 2015 competitions, where we also won the 1st places on the tasks of ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation.`),zo=p(),ls=o("p"),qa=l("Tips:"),Vo=p(),is=o("ul"),Ke=o("li"),Ha=l("One can use "),ds=o("a"),La=l("AutoImageProcessor"),Oa=l(" to prepare images for the model."),Go=p(),ue=o("p"),Da=l("The figure below illustrates the architecture of ResNet. Taken from the "),et=o("a"),Ka=l("original paper"),en=l("."),Xo=p(),tt=o("img"),Qo=p(),A=o("p"),tn=l("This model was contributed by "),st=o("a"),sn=l("Francesco"),on=l(". The TensorFlow version of this model was added by "),ot=o("a"),an=l("amyeroberts"),nn=l(". The original code can be found "),at=o("a"),rn=l("here"),ln=l("."),So=p(),D=o("h2"),ge=o("a"),zs=o("span"),w(nt.$$.fragment),dn=p(),Vs=o("span"),cn=l("Resources"),Yo=p(),cs=o("p"),pn=l("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),qo=p(),w(rt.$$.fragment),Ho=p(),_e=o("ul"),H=o("li"),ps=o("a"),mn=l("ResNetForImageClassification"),fn=l(" is supported by this "),lt=o("a"),hn=l("example script"),un=l(" and "),it=o("a"),gn=l("notebook"),_n=l("."),yn=p(),ms=o("li"),bn=l("See also: "),fs=o("a"),wn=l("Image classification task guide"),Lo=p(),hs=o("p"),vn=l("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Oo=p(),K=o("h2"),ye=o("a"),Gs=o("span"),w(dt.$$.fragment),Tn=p(),Xs=o("span"),$n=l("ResNetConfig"),Do=p(),Z=o("div"),w(ct.$$.fragment),Mn=p(),ee=o("p"),Nn=l("This is the configuration class to store the configuration of a "),us=o("a"),Rn=l("ResNetModel"),Fn=l(`. It is used to instantiate an
ResNet model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the ResNet
`),pt=o("a"),jn=l("microsoft/resnet-50"),Jn=l(" architecture."),In=p(),te=o("p"),Cn=l("Configuration objects inherit from "),gs=o("a"),En=l("PretrainedConfig"),xn=l(` and can be used to control the model outputs. Read the
documentation from `),_s=o("a"),Zn=l("PretrainedConfig"),Un=l(" for more information."),Wn=p(),w(be.$$.fragment),Ko=p(),se=o("h2"),we=o("a"),Qs=o("span"),w(mt.$$.fragment),kn=p(),Ss=o("span"),An=l("ResNetModel"),ea=p(),Q=o("div"),w(ft.$$.fragment),Bn=p(),ht=o("p"),Pn=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),ut=o("a"),zn=l("torch.nn.Module"),Vn=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Gn=p(),B=o("div"),w(gt.$$.fragment),Xn=p(),oe=o("p"),Qn=l("The "),ys=o("a"),Sn=l("ResNetModel"),Yn=l(" forward method, overrides the "),Ys=o("code"),qn=l("__call__"),Hn=l(" special method."),Ln=p(),w(ve.$$.fragment),On=p(),w(Te.$$.fragment),ta=p(),ae=o("h2"),$e=o("a"),qs=o("span"),w(_t.$$.fragment),Dn=p(),Hs=o("span"),Kn=l("ResNetForImageClassification"),sa=p(),U=o("div"),w(yt.$$.fragment),er=p(),Ls=o("p"),tr=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),sr=p(),bt=o("p"),or=l("This model is a PyTorch "),wt=o("a"),ar=l("torch.nn.Module"),nr=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),rr=p(),P=o("div"),w(vt.$$.fragment),lr=p(),ne=o("p"),ir=l("The "),bs=o("a"),dr=l("ResNetForImageClassification"),cr=l(" forward method, overrides the "),Os=o("code"),pr=l("__call__"),mr=l(" special method."),fr=p(),w(Me.$$.fragment),hr=p(),w(Ne.$$.fragment),oa=p(),re=o("h2"),Re=o("a"),Ds=o("span"),w(Tt.$$.fragment),ur=p(),Ks=o("span"),gr=l("TFResNetModel"),aa=p(),S=o("div"),w($t.$$.fragment),_r=p(),Mt=o("p"),yr=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a TensorFlow
`),Nt=o("a"),br=l("tf.keras.layers.Layer"),wr=l(` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),vr=p(),z=o("div"),w(Rt.$$.fragment),Tr=p(),le=o("p"),$r=l("The "),ws=o("a"),Mr=l("TFResNetModel"),Nr=l(" forward method, overrides the "),eo=o("code"),Rr=l("__call__"),Fr=l(" special method."),jr=p(),w(Fe.$$.fragment),Jr=p(),w(je.$$.fragment),na=p(),ie=o("h2"),Je=o("a"),to=o("span"),w(Ft.$$.fragment),Ir=p(),so=o("span"),Cr=l("TFResNetForImageClassification"),ra=p(),W=o("div"),w(jt.$$.fragment),Er=p(),oo=o("p"),xr=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Zr=p(),Jt=o("p"),Ur=l(`This model is a TensorFlow
`),It=o("a"),Wr=l("tf.keras.layers.Layer"),kr=l(` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),Ar=p(),V=o("div"),w(Ct.$$.fragment),Br=p(),de=o("p"),Pr=l("The "),vs=o("a"),zr=l("TFResNetForImageClassification"),Vr=l(" forward method, overrides the "),ao=o("code"),Gr=l("__call__"),Xr=l(" special method."),Qr=p(),w(Ie.$$.fragment),Sr=p(),w(Ce.$$.fragment),la=p(),ce=o("h2"),Ee=o("a"),no=o("span"),w(Et.$$.fragment),Yr=p(),ro=o("span"),qr=l("FlaxResNetModel"),ia=p(),j=o("div"),w(xt.$$.fragment),Hr=p(),lo=o("p"),Lr=l("The bare ResNet model outputting raw features without any specific head on top."),Or=p(),Zt=o("p"),Dr=l("This model inherits from "),Ts=o("a"),Kr=l("FlaxPreTrainedModel"),el=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),tl=p(),Ut=o("p"),sl=l("This model is also a Flax Linen "),Wt=o("a"),ol=l("flax.linen.Module"),al=l(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),nl=p(),io=o("p"),rl=l("Finally, this model supports inherent JAX features such as:"),ll=p(),Y=o("ul"),co=o("li"),kt=o("a"),il=l("Just-In-Time (JIT) compilation"),dl=p(),po=o("li"),At=o("a"),cl=l("Automatic Differentiation"),pl=p(),mo=o("li"),Bt=o("a"),ml=l("Vectorization"),fl=p(),fo=o("li"),Pt=o("a"),hl=l("Parallelization"),ul=p(),G=o("div"),w(zt.$$.fragment),gl=p(),pe=o("p"),_l=l("The "),ho=o("code"),yl=l("FlaxResNetPreTrainedModel"),bl=l(" forward method, overrides the "),uo=o("code"),wl=l("__call__"),vl=l(" special method."),Tl=p(),w(xe.$$.fragment),$l=p(),w(Ze.$$.fragment),da=p(),me=o("h2"),Ue=o("a"),go=o("span"),w(Vt.$$.fragment),Ml=p(),_o=o("span"),Nl=l("FlaxResNetForImageClassification"),ca=p(),J=o("div"),w(Gt.$$.fragment),Rl=p(),yo=o("p"),Fl=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),jl=p(),Xt=o("p"),Jl=l("This model inherits from "),$s=o("a"),Il=l("FlaxPreTrainedModel"),Cl=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),El=p(),Qt=o("p"),xl=l("This model is also a Flax Linen "),St=o("a"),Zl=l("flax.linen.Module"),Ul=l(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Wl=p(),bo=o("p"),kl=l("Finally, this model supports inherent JAX features such as:"),Al=p(),q=o("ul"),wo=o("li"),Yt=o("a"),Bl=l("Just-In-Time (JIT) compilation"),Pl=p(),vo=o("li"),qt=o("a"),zl=l("Automatic Differentiation"),Vl=p(),To=o("li"),Ht=o("a"),Gl=l("Vectorization"),Xl=p(),$o=o("li"),Lt=o("a"),Ql=l("Parallelization"),Sl=p(),X=o("div"),w(Ot.$$.fragment),Yl=p(),fe=o("p"),ql=l("The "),Mo=o("code"),Hl=l("FlaxResNetPreTrainedModel"),Ll=l(" forward method, overrides the "),No=o("code"),Ol=l("__call__"),Dl=l(" special method."),Kl=p(),w(We.$$.fragment),ei=p(),w(ke.$$.fragment),this.h()},l(t){const h=Pd('[data-svelte="svelte-1phssyn"]',document.head);c=a(h,"META",{name:!0,content:!0}),h.forEach(s),b=m(t),g=a(t,"H1",{class:!0});var Dt=n(g);u=a(Dt,"A",{id:!0,class:!0,href:!0});var Ro=n(u);y=a(Ro,"SPAN",{});var Fo=n(y);v(r.$$.fragment,Fo),Fo.forEach(s),Ro.forEach(s),f=m(Dt),F=a(Dt,"SPAN",{});var jo=n(F);Ca=i(jo,"ResNet"),jo.forEach(s),Dt.forEach(s),Wo=m(t),O=a(t,"H2",{class:!0});var Kt=n(O);he=a(Kt,"A",{id:!0,class:!0,href:!0});var Jo=n(he);Us=a(Jo,"SPAN",{});var Io=n(Us);v(Le.$$.fragment,Io),Io.forEach(s),Jo.forEach(s),Ea=m(Kt),Ws=a(Kt,"SPAN",{});var Co=n(Ws);xa=i(Co,"Overview"),Co.forEach(s),Kt.forEach(s),ko=m(t),I=a(t,"P",{});var C=n(I);Za=i(C,"The ResNet model was proposed in "),Oe=a(C,"A",{href:!0,rel:!0});var Eo=n(Oe);Ua=i(Eo,"Deep Residual Learning for Image Recognition"),Eo.forEach(s),Wa=i(C," by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun. Our implementation follows the small changes made by "),De=a(C,"A",{href:!0,rel:!0});var xo=n(De);ka=i(xo,"Nvidia"),xo.forEach(s),Aa=i(C,", we apply the "),ks=a(C,"CODE",{});var Zo=n(ks);Ba=i(Zo,"stride=2"),Zo.forEach(s),Pa=i(C," for downsampling in bottleneck\u2019s "),As=a(C,"CODE",{});var Uo=n(As);za=i(Uo,"3x3"),Uo.forEach(s),Va=i(C," conv and not in the first "),Bs=a(C,"CODE",{});var oi=n(Bs);Ga=i(oi,"1x1"),oi.forEach(s),Xa=i(C,". This is generally known as \u201CResNet v1.5\u201D."),C.forEach(s),Ao=m(t),as=a(t,"P",{});var ai=n(as);Qa=i(ai,"ResNet introduced residual connections, they allow to train networks with an unseen number of layers (up to 1000). ResNet won the 2015 ILSVRC & COCO competition, one important milestone in deep computer vision."),ai.forEach(s),Bo=m(t),ns=a(t,"P",{});var ni=n(ns);Sa=i(ni,"The abstract from the paper is the following:"),ni.forEach(s),Po=m(t),rs=a(t,"P",{});var ri=n(rs);Ps=a(ri,"EM",{});var li=n(Ps);Ya=i(li,`Deeper neural networks are more difficult to train. We present a residual learning framework to ease the training of networks that are substantially deeper than those used previously. We explicitly reformulate the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. We provide comprehensive empirical evidence showing that these residual networks are easier to optimize, and can gain accuracy from considerably increased depth. On the ImageNet dataset we evaluate residual nets with a depth of up to 152 layers---8x deeper than VGG nets but still having lower complexity. An ensemble of these residual nets achieves 3.57% error on the ImageNet test set. This result won the 1st place on the ILSVRC 2015 classification task. We also present analysis on CIFAR-10 with 100 and 1000 layers.
The depth of representations is of central importance for many visual recognition tasks. Solely due to our extremely deep representations, we obtain a 28% relative improvement on the COCO object detection dataset. Deep residual nets are foundations of our submissions to ILSVRC & COCO 2015 competitions, where we also won the 1st places on the tasks of ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation.`),li.forEach(s),ri.forEach(s),zo=m(t),ls=a(t,"P",{});var ii=n(ls);qa=i(ii,"Tips:"),ii.forEach(s),Vo=m(t),is=a(t,"UL",{});var di=n(is);Ke=a(di,"LI",{});var ma=n(Ke);Ha=i(ma,"One can use "),ds=a(ma,"A",{href:!0});var ci=n(ds);La=i(ci,"AutoImageProcessor"),ci.forEach(s),Oa=i(ma," to prepare images for the model."),ma.forEach(s),di.forEach(s),Go=m(t),ue=a(t,"P",{});var fa=n(ue);Da=i(fa,"The figure below illustrates the architecture of ResNet. Taken from the "),et=a(fa,"A",{href:!0,rel:!0});var pi=n(et);Ka=i(pi,"original paper"),pi.forEach(s),en=i(fa,"."),fa.forEach(s),Xo=m(t),tt=a(t,"IMG",{width:!0,src:!0}),Qo=m(t),A=a(t,"P",{});var Ae=n(A);tn=i(Ae,"This model was contributed by "),st=a(Ae,"A",{href:!0,rel:!0});var mi=n(st);sn=i(mi,"Francesco"),mi.forEach(s),on=i(Ae,". The TensorFlow version of this model was added by "),ot=a(Ae,"A",{href:!0,rel:!0});var fi=n(ot);an=i(fi,"amyeroberts"),fi.forEach(s),nn=i(Ae,". The original code can be found "),at=a(Ae,"A",{href:!0,rel:!0});var hi=n(at);rn=i(hi,"here"),hi.forEach(s),ln=i(Ae,"."),Ae.forEach(s),So=m(t),D=a(t,"H2",{class:!0});var ha=n(D);ge=a(ha,"A",{id:!0,class:!0,href:!0});var ui=n(ge);zs=a(ui,"SPAN",{});var gi=n(zs);v(nt.$$.fragment,gi),gi.forEach(s),ui.forEach(s),dn=m(ha),Vs=a(ha,"SPAN",{});var _i=n(Vs);cn=i(_i,"Resources"),_i.forEach(s),ha.forEach(s),Yo=m(t),cs=a(t,"P",{});var yi=n(cs);pn=i(yi,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),yi.forEach(s),qo=m(t),v(rt.$$.fragment,t),Ho=m(t),_e=a(t,"UL",{});var ua=n(_e);H=a(ua,"LI",{});var es=n(H);ps=a(es,"A",{href:!0});var bi=n(ps);mn=i(bi,"ResNetForImageClassification"),bi.forEach(s),fn=i(es," is supported by this "),lt=a(es,"A",{href:!0,rel:!0});var wi=n(lt);hn=i(wi,"example script"),wi.forEach(s),un=i(es," and "),it=a(es,"A",{href:!0,rel:!0});var vi=n(it);gn=i(vi,"notebook"),vi.forEach(s),_n=i(es,"."),es.forEach(s),yn=m(ua),ms=a(ua,"LI",{});var ti=n(ms);bn=i(ti,"See also: "),fs=a(ti,"A",{href:!0});var Ti=n(fs);wn=i(Ti,"Image classification task guide"),Ti.forEach(s),ti.forEach(s),ua.forEach(s),Lo=m(t),hs=a(t,"P",{});var $i=n(hs);vn=i($i,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),$i.forEach(s),Oo=m(t),K=a(t,"H2",{class:!0});var ga=n(K);ye=a(ga,"A",{id:!0,class:!0,href:!0});var Mi=n(ye);Gs=a(Mi,"SPAN",{});var Ni=n(Gs);v(dt.$$.fragment,Ni),Ni.forEach(s),Mi.forEach(s),Tn=m(ga),Xs=a(ga,"SPAN",{});var Ri=n(Xs);$n=i(Ri,"ResNetConfig"),Ri.forEach(s),ga.forEach(s),Do=m(t),Z=a(t,"DIV",{class:!0});var Be=n(Z);v(ct.$$.fragment,Be),Mn=m(Be),ee=a(Be,"P",{});var Ms=n(ee);Nn=i(Ms,"This is the configuration class to store the configuration of a "),us=a(Ms,"A",{href:!0});var Fi=n(us);Rn=i(Fi,"ResNetModel"),Fi.forEach(s),Fn=i(Ms,`. It is used to instantiate an
ResNet model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the ResNet
`),pt=a(Ms,"A",{href:!0,rel:!0});var ji=n(pt);jn=i(ji,"microsoft/resnet-50"),ji.forEach(s),Jn=i(Ms," architecture."),Ms.forEach(s),In=m(Be),te=a(Be,"P",{});var Ns=n(te);Cn=i(Ns,"Configuration objects inherit from "),gs=a(Ns,"A",{href:!0});var Ji=n(gs);En=i(Ji,"PretrainedConfig"),Ji.forEach(s),xn=i(Ns,` and can be used to control the model outputs. Read the
documentation from `),_s=a(Ns,"A",{href:!0});var Ii=n(_s);Zn=i(Ii,"PretrainedConfig"),Ii.forEach(s),Un=i(Ns," for more information."),Ns.forEach(s),Wn=m(Be),v(be.$$.fragment,Be),Be.forEach(s),Ko=m(t),se=a(t,"H2",{class:!0});var _a=n(se);we=a(_a,"A",{id:!0,class:!0,href:!0});var Ci=n(we);Qs=a(Ci,"SPAN",{});var Ei=n(Qs);v(mt.$$.fragment,Ei),Ei.forEach(s),Ci.forEach(s),kn=m(_a),Ss=a(_a,"SPAN",{});var xi=n(Ss);An=i(xi,"ResNetModel"),xi.forEach(s),_a.forEach(s),ea=m(t),Q=a(t,"DIV",{class:!0});var Rs=n(Q);v(ft.$$.fragment,Rs),Bn=m(Rs),ht=a(Rs,"P",{});var ya=n(ht);Pn=i(ya,`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),ut=a(ya,"A",{href:!0,rel:!0});var Zi=n(ut);zn=i(Zi,"torch.nn.Module"),Zi.forEach(s),Vn=i(ya,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ya.forEach(s),Gn=m(Rs),B=a(Rs,"DIV",{class:!0});var Pe=n(B);v(gt.$$.fragment,Pe),Xn=m(Pe),oe=a(Pe,"P",{});var Fs=n(oe);Qn=i(Fs,"The "),ys=a(Fs,"A",{href:!0});var Ui=n(ys);Sn=i(Ui,"ResNetModel"),Ui.forEach(s),Yn=i(Fs," forward method, overrides the "),Ys=a(Fs,"CODE",{});var Wi=n(Ys);qn=i(Wi,"__call__"),Wi.forEach(s),Hn=i(Fs," special method."),Fs.forEach(s),Ln=m(Pe),v(ve.$$.fragment,Pe),On=m(Pe),v(Te.$$.fragment,Pe),Pe.forEach(s),Rs.forEach(s),ta=m(t),ae=a(t,"H2",{class:!0});var ba=n(ae);$e=a(ba,"A",{id:!0,class:!0,href:!0});var ki=n($e);qs=a(ki,"SPAN",{});var Ai=n(qs);v(_t.$$.fragment,Ai),Ai.forEach(s),ki.forEach(s),Dn=m(ba),Hs=a(ba,"SPAN",{});var Bi=n(Hs);Kn=i(Bi,"ResNetForImageClassification"),Bi.forEach(s),ba.forEach(s),sa=m(t),U=a(t,"DIV",{class:!0});var ze=n(U);v(yt.$$.fragment,ze),er=m(ze),Ls=a(ze,"P",{});var Pi=n(Ls);tr=i(Pi,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Pi.forEach(s),sr=m(ze),bt=a(ze,"P",{});var wa=n(bt);or=i(wa,"This model is a PyTorch "),wt=a(wa,"A",{href:!0,rel:!0});var zi=n(wt);ar=i(zi,"torch.nn.Module"),zi.forEach(s),nr=i(wa,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wa.forEach(s),rr=m(ze),P=a(ze,"DIV",{class:!0});var Ve=n(P);v(vt.$$.fragment,Ve),lr=m(Ve),ne=a(Ve,"P",{});var js=n(ne);ir=i(js,"The "),bs=a(js,"A",{href:!0});var Vi=n(bs);dr=i(Vi,"ResNetForImageClassification"),Vi.forEach(s),cr=i(js," forward method, overrides the "),Os=a(js,"CODE",{});var Gi=n(Os);pr=i(Gi,"__call__"),Gi.forEach(s),mr=i(js," special method."),js.forEach(s),fr=m(Ve),v(Me.$$.fragment,Ve),hr=m(Ve),v(Ne.$$.fragment,Ve),Ve.forEach(s),ze.forEach(s),oa=m(t),re=a(t,"H2",{class:!0});var va=n(re);Re=a(va,"A",{id:!0,class:!0,href:!0});var Xi=n(Re);Ds=a(Xi,"SPAN",{});var Qi=n(Ds);v(Tt.$$.fragment,Qi),Qi.forEach(s),Xi.forEach(s),ur=m(va),Ks=a(va,"SPAN",{});var Si=n(Ks);gr=i(Si,"TFResNetModel"),Si.forEach(s),va.forEach(s),aa=m(t),S=a(t,"DIV",{class:!0});var Js=n(S);v($t.$$.fragment,Js),_r=m(Js),Mt=a(Js,"P",{});var Ta=n(Mt);yr=i(Ta,`The bare ResNet model outputting raw features without any specific head on top.
This model is a TensorFlow
`),Nt=a(Ta,"A",{href:!0,rel:!0});var Yi=n(Nt);br=i(Yi,"tf.keras.layers.Layer"),Yi.forEach(s),wr=i(Ta,` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),Ta.forEach(s),vr=m(Js),z=a(Js,"DIV",{class:!0});var Ge=n(z);v(Rt.$$.fragment,Ge),Tr=m(Ge),le=a(Ge,"P",{});var Is=n(le);$r=i(Is,"The "),ws=a(Is,"A",{href:!0});var qi=n(ws);Mr=i(qi,"TFResNetModel"),qi.forEach(s),Nr=i(Is," forward method, overrides the "),eo=a(Is,"CODE",{});var Hi=n(eo);Rr=i(Hi,"__call__"),Hi.forEach(s),Fr=i(Is," special method."),Is.forEach(s),jr=m(Ge),v(Fe.$$.fragment,Ge),Jr=m(Ge),v(je.$$.fragment,Ge),Ge.forEach(s),Js.forEach(s),na=m(t),ie=a(t,"H2",{class:!0});var $a=n(ie);Je=a($a,"A",{id:!0,class:!0,href:!0});var Li=n(Je);to=a(Li,"SPAN",{});var Oi=n(to);v(Ft.$$.fragment,Oi),Oi.forEach(s),Li.forEach(s),Ir=m($a),so=a($a,"SPAN",{});var Di=n(so);Cr=i(Di,"TFResNetForImageClassification"),Di.forEach(s),$a.forEach(s),ra=m(t),W=a(t,"DIV",{class:!0});var Xe=n(W);v(jt.$$.fragment,Xe),Er=m(Xe),oo=a(Xe,"P",{});var Ki=n(oo);xr=i(Ki,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Ki.forEach(s),Zr=m(Xe),Jt=a(Xe,"P",{});var Ma=n(Jt);Ur=i(Ma,`This model is a TensorFlow
`),It=a(Ma,"A",{href:!0,rel:!0});var ed=n(It);Wr=i(ed,"tf.keras.layers.Layer"),ed.forEach(s),kr=i(Ma,` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),Ma.forEach(s),Ar=m(Xe),V=a(Xe,"DIV",{class:!0});var Qe=n(V);v(Ct.$$.fragment,Qe),Br=m(Qe),de=a(Qe,"P",{});var Cs=n(de);Pr=i(Cs,"The "),vs=a(Cs,"A",{href:!0});var td=n(vs);zr=i(td,"TFResNetForImageClassification"),td.forEach(s),Vr=i(Cs," forward method, overrides the "),ao=a(Cs,"CODE",{});var sd=n(ao);Gr=i(sd,"__call__"),sd.forEach(s),Xr=i(Cs," special method."),Cs.forEach(s),Qr=m(Qe),v(Ie.$$.fragment,Qe),Sr=m(Qe),v(Ce.$$.fragment,Qe),Qe.forEach(s),Xe.forEach(s),la=m(t),ce=a(t,"H2",{class:!0});var Na=n(ce);Ee=a(Na,"A",{id:!0,class:!0,href:!0});var od=n(Ee);no=a(od,"SPAN",{});var ad=n(no);v(Et.$$.fragment,ad),ad.forEach(s),od.forEach(s),Yr=m(Na),ro=a(Na,"SPAN",{});var nd=n(ro);qr=i(nd,"FlaxResNetModel"),nd.forEach(s),Na.forEach(s),ia=m(t),j=a(t,"DIV",{class:!0});var E=n(j);v(xt.$$.fragment,E),Hr=m(E),lo=a(E,"P",{});var rd=n(lo);Lr=i(rd,"The bare ResNet model outputting raw features without any specific head on top."),rd.forEach(s),Or=m(E),Zt=a(E,"P",{});var Ra=n(Zt);Dr=i(Ra,"This model inherits from "),Ts=a(Ra,"A",{href:!0});var ld=n(Ts);Kr=i(ld,"FlaxPreTrainedModel"),ld.forEach(s),el=i(Ra,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Ra.forEach(s),tl=m(E),Ut=a(E,"P",{});var Fa=n(Ut);sl=i(Fa,"This model is also a Flax Linen "),Wt=a(Fa,"A",{href:!0,rel:!0});var id=n(Wt);ol=i(id,"flax.linen.Module"),id.forEach(s),al=i(Fa,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Fa.forEach(s),nl=m(E),io=a(E,"P",{});var dd=n(io);rl=i(dd,"Finally, this model supports inherent JAX features such as:"),dd.forEach(s),ll=m(E),Y=a(E,"UL",{});var Se=n(Y);co=a(Se,"LI",{});var cd=n(co);kt=a(cd,"A",{href:!0,rel:!0});var pd=n(kt);il=i(pd,"Just-In-Time (JIT) compilation"),pd.forEach(s),cd.forEach(s),dl=m(Se),po=a(Se,"LI",{});var md=n(po);At=a(md,"A",{href:!0,rel:!0});var fd=n(At);cl=i(fd,"Automatic Differentiation"),fd.forEach(s),md.forEach(s),pl=m(Se),mo=a(Se,"LI",{});var hd=n(mo);Bt=a(hd,"A",{href:!0,rel:!0});var ud=n(Bt);ml=i(ud,"Vectorization"),ud.forEach(s),hd.forEach(s),fl=m(Se),fo=a(Se,"LI",{});var gd=n(fo);Pt=a(gd,"A",{href:!0,rel:!0});var _d=n(Pt);hl=i(_d,"Parallelization"),_d.forEach(s),gd.forEach(s),Se.forEach(s),ul=m(E),G=a(E,"DIV",{class:!0});var Ye=n(G);v(zt.$$.fragment,Ye),gl=m(Ye),pe=a(Ye,"P",{});var Es=n(pe);_l=i(Es,"The "),ho=a(Es,"CODE",{});var yd=n(ho);yl=i(yd,"FlaxResNetPreTrainedModel"),yd.forEach(s),bl=i(Es," forward method, overrides the "),uo=a(Es,"CODE",{});var bd=n(uo);wl=i(bd,"__call__"),bd.forEach(s),vl=i(Es," special method."),Es.forEach(s),Tl=m(Ye),v(xe.$$.fragment,Ye),$l=m(Ye),v(Ze.$$.fragment,Ye),Ye.forEach(s),E.forEach(s),da=m(t),me=a(t,"H2",{class:!0});var ja=n(me);Ue=a(ja,"A",{id:!0,class:!0,href:!0});var wd=n(Ue);go=a(wd,"SPAN",{});var vd=n(go);v(Vt.$$.fragment,vd),vd.forEach(s),wd.forEach(s),Ml=m(ja),_o=a(ja,"SPAN",{});var Td=n(_o);Nl=i(Td,"FlaxResNetForImageClassification"),Td.forEach(s),ja.forEach(s),ca=m(t),J=a(t,"DIV",{class:!0});var x=n(J);v(Gt.$$.fragment,x),Rl=m(x),yo=a(x,"P",{});var $d=n(yo);Fl=i($d,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),$d.forEach(s),jl=m(x),Xt=a(x,"P",{});var Ja=n(Xt);Jl=i(Ja,"This model inherits from "),$s=a(Ja,"A",{href:!0});var Md=n($s);Il=i(Md,"FlaxPreTrainedModel"),Md.forEach(s),Cl=i(Ja,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Ja.forEach(s),El=m(x),Qt=a(x,"P",{});var Ia=n(Qt);xl=i(Ia,"This model is also a Flax Linen "),St=a(Ia,"A",{href:!0,rel:!0});var Nd=n(St);Zl=i(Nd,"flax.linen.Module"),Nd.forEach(s),Ul=i(Ia,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Ia.forEach(s),Wl=m(x),bo=a(x,"P",{});var Rd=n(bo);kl=i(Rd,"Finally, this model supports inherent JAX features such as:"),Rd.forEach(s),Al=m(x),q=a(x,"UL",{});var qe=n(q);wo=a(qe,"LI",{});var Fd=n(wo);Yt=a(Fd,"A",{href:!0,rel:!0});var jd=n(Yt);Bl=i(jd,"Just-In-Time (JIT) compilation"),jd.forEach(s),Fd.forEach(s),Pl=m(qe),vo=a(qe,"LI",{});var Jd=n(vo);qt=a(Jd,"A",{href:!0,rel:!0});var Id=n(qt);zl=i(Id,"Automatic Differentiation"),Id.forEach(s),Jd.forEach(s),Vl=m(qe),To=a(qe,"LI",{});var Cd=n(To);Ht=a(Cd,"A",{href:!0,rel:!0});var Ed=n(Ht);Gl=i(Ed,"Vectorization"),Ed.forEach(s),Cd.forEach(s),Xl=m(qe),$o=a(qe,"LI",{});var xd=n($o);Lt=a(xd,"A",{href:!0,rel:!0});var Zd=n(Lt);Ql=i(Zd,"Parallelization"),Zd.forEach(s),xd.forEach(s),qe.forEach(s),Sl=m(x),X=a(x,"DIV",{class:!0});var He=n(X);v(Ot.$$.fragment,He),Yl=m(He),fe=a(He,"P",{});var xs=n(fe);ql=i(xs,"The "),Mo=a(xs,"CODE",{});var Ud=n(Mo);Hl=i(Ud,"FlaxResNetPreTrainedModel"),Ud.forEach(s),Ll=i(xs," forward method, overrides the "),No=a(xs,"CODE",{});var Wd=n(No);Ol=i(Wd,"__call__"),Wd.forEach(s),Dl=i(xs," special method."),xs.forEach(s),Kl=m(He),v(We.$$.fragment,He),ei=m(He),v(ke.$$.fragment,He),He.forEach(s),x.forEach(s),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(ac)),d(u,"id","resnet"),d(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(u,"href","#resnet"),d(g,"class","relative group"),d(he,"id","overview"),d(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(he,"href","#overview"),d(O,"class","relative group"),d(Oe,"href","https://arxiv.org/abs/1512.03385"),d(Oe,"rel","nofollow"),d(De,"href","https://catalog.ngc.nvidia.com/orgs/nvidia/resources/resnet_50_v1_5_for_pytorch"),d(De,"rel","nofollow"),d(ds,"href","/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor"),d(et,"href","https://arxiv.org/abs/1512.03385"),d(et,"rel","nofollow"),d(tt,"width","600"),zd(tt.src,si="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/resnet_architecture.png")||d(tt,"src",si),d(st,"href","https://huggingface.co/Francesco"),d(st,"rel","nofollow"),d(ot,"href","https://huggingface.co/amyeroberts"),d(ot,"rel","nofollow"),d(at,"href","https://github.com/KaimingHe/deep-residual-networks"),d(at,"rel","nofollow"),d(ge,"id","resources"),d(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ge,"href","#resources"),d(D,"class","relative group"),d(ps,"href","/docs/transformers/main/en/model_doc/resnet#transformers.ResNetForImageClassification"),d(lt,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),d(lt,"rel","nofollow"),d(it,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),d(it,"rel","nofollow"),d(fs,"href","../tasks/image_classification"),d(ye,"id","transformers.ResNetConfig"),d(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ye,"href","#transformers.ResNetConfig"),d(K,"class","relative group"),d(us,"href","/docs/transformers/main/en/model_doc/resnet#transformers.ResNetModel"),d(pt,"href","https://huggingface.co/microsoft/resnet-50"),d(pt,"rel","nofollow"),d(gs,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(_s,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(we,"id","transformers.ResNetModel"),d(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(we,"href","#transformers.ResNetModel"),d(se,"class","relative group"),d(ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ut,"rel","nofollow"),d(ys,"href","/docs/transformers/main/en/model_doc/resnet#transformers.ResNetModel"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($e,"id","transformers.ResNetForImageClassification"),d($e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d($e,"href","#transformers.ResNetForImageClassification"),d(ae,"class","relative group"),d(wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(wt,"rel","nofollow"),d(bs,"href","/docs/transformers/main/en/model_doc/resnet#transformers.ResNetForImageClassification"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"id","transformers.TFResNetModel"),d(Re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Re,"href","#transformers.TFResNetModel"),d(re,"class","relative group"),d(Nt,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d(Nt,"rel","nofollow"),d(ws,"href","/docs/transformers/main/en/model_doc/resnet#transformers.TFResNetModel"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Je,"id","transformers.TFResNetForImageClassification"),d(Je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Je,"href","#transformers.TFResNetForImageClassification"),d(ie,"class","relative group"),d(It,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d(It,"rel","nofollow"),d(vs,"href","/docs/transformers/main/en/model_doc/resnet#transformers.TFResNetForImageClassification"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ee,"id","transformers.FlaxResNetModel"),d(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ee,"href","#transformers.FlaxResNetModel"),d(ce,"class","relative group"),d(Ts,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(Wt,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(Wt,"rel","nofollow"),d(kt,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(kt,"rel","nofollow"),d(At,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(At,"rel","nofollow"),d(Bt,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Bt,"rel","nofollow"),d(Pt,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Pt,"rel","nofollow"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ue,"id","transformers.FlaxResNetForImageClassification"),d(Ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ue,"href","#transformers.FlaxResNetForImageClassification"),d(me,"class","relative group"),d($s,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(St,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(St,"rel","nofollow"),d(Yt,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(Yt,"rel","nofollow"),d(qt,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(qt,"rel","nofollow"),d(Ht,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Ht,"rel","nofollow"),d(Lt,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Lt,"rel","nofollow"),d(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,c),_(t,b,h),_(t,g,h),e(g,u),e(u,y),T(r,y,null),e(g,f),e(g,F),e(F,Ca),_(t,Wo,h),_(t,O,h),e(O,he),e(he,Us),T(Le,Us,null),e(O,Ea),e(O,Ws),e(Ws,xa),_(t,ko,h),_(t,I,h),e(I,Za),e(I,Oe),e(Oe,Ua),e(I,Wa),e(I,De),e(De,ka),e(I,Aa),e(I,ks),e(ks,Ba),e(I,Pa),e(I,As),e(As,za),e(I,Va),e(I,Bs),e(Bs,Ga),e(I,Xa),_(t,Ao,h),_(t,as,h),e(as,Qa),_(t,Bo,h),_(t,ns,h),e(ns,Sa),_(t,Po,h),_(t,rs,h),e(rs,Ps),e(Ps,Ya),_(t,zo,h),_(t,ls,h),e(ls,qa),_(t,Vo,h),_(t,is,h),e(is,Ke),e(Ke,Ha),e(Ke,ds),e(ds,La),e(Ke,Oa),_(t,Go,h),_(t,ue,h),e(ue,Da),e(ue,et),e(et,Ka),e(ue,en),_(t,Xo,h),_(t,tt,h),_(t,Qo,h),_(t,A,h),e(A,tn),e(A,st),e(st,sn),e(A,on),e(A,ot),e(ot,an),e(A,nn),e(A,at),e(at,rn),e(A,ln),_(t,So,h),_(t,D,h),e(D,ge),e(ge,zs),T(nt,zs,null),e(D,dn),e(D,Vs),e(Vs,cn),_(t,Yo,h),_(t,cs,h),e(cs,pn),_(t,qo,h),T(rt,t,h),_(t,Ho,h),_(t,_e,h),e(_e,H),e(H,ps),e(ps,mn),e(H,fn),e(H,lt),e(lt,hn),e(H,un),e(H,it),e(it,gn),e(H,_n),e(_e,yn),e(_e,ms),e(ms,bn),e(ms,fs),e(fs,wn),_(t,Lo,h),_(t,hs,h),e(hs,vn),_(t,Oo,h),_(t,K,h),e(K,ye),e(ye,Gs),T(dt,Gs,null),e(K,Tn),e(K,Xs),e(Xs,$n),_(t,Do,h),_(t,Z,h),T(ct,Z,null),e(Z,Mn),e(Z,ee),e(ee,Nn),e(ee,us),e(us,Rn),e(ee,Fn),e(ee,pt),e(pt,jn),e(ee,Jn),e(Z,In),e(Z,te),e(te,Cn),e(te,gs),e(gs,En),e(te,xn),e(te,_s),e(_s,Zn),e(te,Un),e(Z,Wn),T(be,Z,null),_(t,Ko,h),_(t,se,h),e(se,we),e(we,Qs),T(mt,Qs,null),e(se,kn),e(se,Ss),e(Ss,An),_(t,ea,h),_(t,Q,h),T(ft,Q,null),e(Q,Bn),e(Q,ht),e(ht,Pn),e(ht,ut),e(ut,zn),e(ht,Vn),e(Q,Gn),e(Q,B),T(gt,B,null),e(B,Xn),e(B,oe),e(oe,Qn),e(oe,ys),e(ys,Sn),e(oe,Yn),e(oe,Ys),e(Ys,qn),e(oe,Hn),e(B,Ln),T(ve,B,null),e(B,On),T(Te,B,null),_(t,ta,h),_(t,ae,h),e(ae,$e),e($e,qs),T(_t,qs,null),e(ae,Dn),e(ae,Hs),e(Hs,Kn),_(t,sa,h),_(t,U,h),T(yt,U,null),e(U,er),e(U,Ls),e(Ls,tr),e(U,sr),e(U,bt),e(bt,or),e(bt,wt),e(wt,ar),e(bt,nr),e(U,rr),e(U,P),T(vt,P,null),e(P,lr),e(P,ne),e(ne,ir),e(ne,bs),e(bs,dr),e(ne,cr),e(ne,Os),e(Os,pr),e(ne,mr),e(P,fr),T(Me,P,null),e(P,hr),T(Ne,P,null),_(t,oa,h),_(t,re,h),e(re,Re),e(Re,Ds),T(Tt,Ds,null),e(re,ur),e(re,Ks),e(Ks,gr),_(t,aa,h),_(t,S,h),T($t,S,null),e(S,_r),e(S,Mt),e(Mt,yr),e(Mt,Nt),e(Nt,br),e(Mt,wr),e(S,vr),e(S,z),T(Rt,z,null),e(z,Tr),e(z,le),e(le,$r),e(le,ws),e(ws,Mr),e(le,Nr),e(le,eo),e(eo,Rr),e(le,Fr),e(z,jr),T(Fe,z,null),e(z,Jr),T(je,z,null),_(t,na,h),_(t,ie,h),e(ie,Je),e(Je,to),T(Ft,to,null),e(ie,Ir),e(ie,so),e(so,Cr),_(t,ra,h),_(t,W,h),T(jt,W,null),e(W,Er),e(W,oo),e(oo,xr),e(W,Zr),e(W,Jt),e(Jt,Ur),e(Jt,It),e(It,Wr),e(Jt,kr),e(W,Ar),e(W,V),T(Ct,V,null),e(V,Br),e(V,de),e(de,Pr),e(de,vs),e(vs,zr),e(de,Vr),e(de,ao),e(ao,Gr),e(de,Xr),e(V,Qr),T(Ie,V,null),e(V,Sr),T(Ce,V,null),_(t,la,h),_(t,ce,h),e(ce,Ee),e(Ee,no),T(Et,no,null),e(ce,Yr),e(ce,ro),e(ro,qr),_(t,ia,h),_(t,j,h),T(xt,j,null),e(j,Hr),e(j,lo),e(lo,Lr),e(j,Or),e(j,Zt),e(Zt,Dr),e(Zt,Ts),e(Ts,Kr),e(Zt,el),e(j,tl),e(j,Ut),e(Ut,sl),e(Ut,Wt),e(Wt,ol),e(Ut,al),e(j,nl),e(j,io),e(io,rl),e(j,ll),e(j,Y),e(Y,co),e(co,kt),e(kt,il),e(Y,dl),e(Y,po),e(po,At),e(At,cl),e(Y,pl),e(Y,mo),e(mo,Bt),e(Bt,ml),e(Y,fl),e(Y,fo),e(fo,Pt),e(Pt,hl),e(j,ul),e(j,G),T(zt,G,null),e(G,gl),e(G,pe),e(pe,_l),e(pe,ho),e(ho,yl),e(pe,bl),e(pe,uo),e(uo,wl),e(pe,vl),e(G,Tl),T(xe,G,null),e(G,$l),T(Ze,G,null),_(t,da,h),_(t,me,h),e(me,Ue),e(Ue,go),T(Vt,go,null),e(me,Ml),e(me,_o),e(_o,Nl),_(t,ca,h),_(t,J,h),T(Gt,J,null),e(J,Rl),e(J,yo),e(yo,Fl),e(J,jl),e(J,Xt),e(Xt,Jl),e(Xt,$s),e($s,Il),e(Xt,Cl),e(J,El),e(J,Qt),e(Qt,xl),e(Qt,St),e(St,Zl),e(Qt,Ul),e(J,Wl),e(J,bo),e(bo,kl),e(J,Al),e(J,q),e(q,wo),e(wo,Yt),e(Yt,Bl),e(q,Pl),e(q,vo),e(vo,qt),e(qt,zl),e(q,Vl),e(q,To),e(To,Ht),e(Ht,Gl),e(q,Xl),e(q,$o),e($o,Lt),e(Lt,Ql),e(J,Sl),e(J,X),T(Ot,X,null),e(X,Yl),e(X,fe),e(fe,ql),e(fe,Mo),e(Mo,Hl),e(fe,Ll),e(fe,No),e(No,Ol),e(fe,Dl),e(X,Kl),T(We,X,null),e(X,ei),T(ke,X,null),pa=!0},p(t,[h]){const Dt={};h&2&&(Dt.$$scope={dirty:h,ctx:t}),be.$set(Dt);const Ro={};h&2&&(Ro.$$scope={dirty:h,ctx:t}),ve.$set(Ro);const Fo={};h&2&&(Fo.$$scope={dirty:h,ctx:t}),Te.$set(Fo);const jo={};h&2&&(jo.$$scope={dirty:h,ctx:t}),Me.$set(jo);const Kt={};h&2&&(Kt.$$scope={dirty:h,ctx:t}),Ne.$set(Kt);const Jo={};h&2&&(Jo.$$scope={dirty:h,ctx:t}),Fe.$set(Jo);const Io={};h&2&&(Io.$$scope={dirty:h,ctx:t}),je.$set(Io);const Co={};h&2&&(Co.$$scope={dirty:h,ctx:t}),Ie.$set(Co);const C={};h&2&&(C.$$scope={dirty:h,ctx:t}),Ce.$set(C);const Eo={};h&2&&(Eo.$$scope={dirty:h,ctx:t}),xe.$set(Eo);const xo={};h&2&&(xo.$$scope={dirty:h,ctx:t}),Ze.$set(xo);const Zo={};h&2&&(Zo.$$scope={dirty:h,ctx:t}),We.$set(Zo);const Uo={};h&2&&(Uo.$$scope={dirty:h,ctx:t}),ke.$set(Uo)},i(t){pa||($(r.$$.fragment,t),$(Le.$$.fragment,t),$(nt.$$.fragment,t),$(rt.$$.fragment,t),$(dt.$$.fragment,t),$(ct.$$.fragment,t),$(be.$$.fragment,t),$(mt.$$.fragment,t),$(ft.$$.fragment,t),$(gt.$$.fragment,t),$(ve.$$.fragment,t),$(Te.$$.fragment,t),$(_t.$$.fragment,t),$(yt.$$.fragment,t),$(vt.$$.fragment,t),$(Me.$$.fragment,t),$(Ne.$$.fragment,t),$(Tt.$$.fragment,t),$($t.$$.fragment,t),$(Rt.$$.fragment,t),$(Fe.$$.fragment,t),$(je.$$.fragment,t),$(Ft.$$.fragment,t),$(jt.$$.fragment,t),$(Ct.$$.fragment,t),$(Ie.$$.fragment,t),$(Ce.$$.fragment,t),$(Et.$$.fragment,t),$(xt.$$.fragment,t),$(zt.$$.fragment,t),$(xe.$$.fragment,t),$(Ze.$$.fragment,t),$(Vt.$$.fragment,t),$(Gt.$$.fragment,t),$(Ot.$$.fragment,t),$(We.$$.fragment,t),$(ke.$$.fragment,t),pa=!0)},o(t){M(r.$$.fragment,t),M(Le.$$.fragment,t),M(nt.$$.fragment,t),M(rt.$$.fragment,t),M(dt.$$.fragment,t),M(ct.$$.fragment,t),M(be.$$.fragment,t),M(mt.$$.fragment,t),M(ft.$$.fragment,t),M(gt.$$.fragment,t),M(ve.$$.fragment,t),M(Te.$$.fragment,t),M(_t.$$.fragment,t),M(yt.$$.fragment,t),M(vt.$$.fragment,t),M(Me.$$.fragment,t),M(Ne.$$.fragment,t),M(Tt.$$.fragment,t),M($t.$$.fragment,t),M(Rt.$$.fragment,t),M(Fe.$$.fragment,t),M(je.$$.fragment,t),M(Ft.$$.fragment,t),M(jt.$$.fragment,t),M(Ct.$$.fragment,t),M(Ie.$$.fragment,t),M(Ce.$$.fragment,t),M(Et.$$.fragment,t),M(xt.$$.fragment,t),M(zt.$$.fragment,t),M(xe.$$.fragment,t),M(Ze.$$.fragment,t),M(Vt.$$.fragment,t),M(Gt.$$.fragment,t),M(Ot.$$.fragment,t),M(We.$$.fragment,t),M(ke.$$.fragment,t),pa=!1},d(t){s(c),t&&s(b),t&&s(g),N(r),t&&s(Wo),t&&s(O),N(Le),t&&s(ko),t&&s(I),t&&s(Ao),t&&s(as),t&&s(Bo),t&&s(ns),t&&s(Po),t&&s(rs),t&&s(zo),t&&s(ls),t&&s(Vo),t&&s(is),t&&s(Go),t&&s(ue),t&&s(Xo),t&&s(tt),t&&s(Qo),t&&s(A),t&&s(So),t&&s(D),N(nt),t&&s(Yo),t&&s(cs),t&&s(qo),N(rt,t),t&&s(Ho),t&&s(_e),t&&s(Lo),t&&s(hs),t&&s(Oo),t&&s(K),N(dt),t&&s(Do),t&&s(Z),N(ct),N(be),t&&s(Ko),t&&s(se),N(mt),t&&s(ea),t&&s(Q),N(ft),N(gt),N(ve),N(Te),t&&s(ta),t&&s(ae),N(_t),t&&s(sa),t&&s(U),N(yt),N(vt),N(Me),N(Ne),t&&s(oa),t&&s(re),N(Tt),t&&s(aa),t&&s(S),N($t),N(Rt),N(Fe),N(je),t&&s(na),t&&s(ie),N(Ft),t&&s(ra),t&&s(W),N(jt),N(Ct),N(Ie),N(Ce),t&&s(la),t&&s(ce),N(Et),t&&s(ia),t&&s(j),N(xt),N(zt),N(xe),N(Ze),t&&s(da),t&&s(me),N(Vt),t&&s(ca),t&&s(J),N(Gt),N(Ot),N(We),N(ke)}}}const ac={local:"resnet",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.ResNetConfig",title:"ResNetConfig"},{local:"transformers.ResNetModel",title:"ResNetModel"},{local:"transformers.ResNetForImageClassification",title:"ResNetForImageClassification"},{local:"transformers.TFResNetModel",title:"TFResNetModel"},{local:"transformers.TFResNetForImageClassification",title:"TFResNetForImageClassification"},{local:"transformers.FlaxResNetModel",title:"FlaxResNetModel"},{local:"transformers.FlaxResNetForImageClassification",title:"FlaxResNetForImageClassification"}],title:"ResNet"};function nc(R){return Vd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fc extends kd{constructor(c){super();Ad(this,c,nc,oc,Bd,{})}}export{fc as default,ac as metadata};
