Skip to content

Commit 8aea331

Browse files
joihnMaxime Gardoni
authored andcommitted
Segformer TF: fix output size in documentation (huggingface#18572)
* Segformer TF: fix output size in doc * Segformer pytorch: fix output size in doc Co-authored-by: Maxime Gardoni <[email protected]>
1 parent 793d978 commit 8aea331

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/transformers/models/segformer/modeling_segformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ def forward(
784784
785785
>>> inputs = feature_extractor(images=image, return_tensors="pt")
786786
>>> outputs = model(**inputs)
787-
>>> logits = outputs.logits # shape (batch_size, num_labels, height, width)
787+
>>> logits = outputs.logits # shape (batch_size, num_labels, height/4, width/4)
788788
>>> list(logits.shape)
789789
[1, 150, 128, 128]
790790
```"""

src/transformers/models/segformer/modeling_tf_segformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ def call(
847847
848848
>>> inputs = feature_extractor(images=image, return_tensors="tf")
849849
>>> outputs = model(**inputs, training=False)
850-
>>> # logits are of shape (batch_size, num_labels, height, width)
850+
>>> # logits are of shape (batch_size, num_labels, height/4, width/4)
851851
>>> logits = outputs.logits
852852
>>> list(logits.shape)
853853
[1, 150, 128, 128]

0 commit comments

Comments
 (0)