Skip to content

Commit

Permalink
Merge pull request #681 from Glenn-Su/patch-1
Browse files Browse the repository at this point in the history
更正错别字
  • Loading branch information
jiangzhonglian authored May 28, 2024
2 parents 8a2d563 + 12cef12 commit 31d7101
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/2.0/tutorials/beginner/basics/data_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def __len__(self):
```
### __getitem__

函数 `__getitem__` 从数据集中给定的索引 ``idx`` 处加载并返回一个样本。根据索引可以确定图像在硬盘上的位置,用 ``read_image`` 将其转换为tensor,从 ``self.img_labels`` 的csv数据中获取相应的标签,最对它们调用 transform 函数(如果适用),并返回tensor图像和相应的标签的元组。
函数 `__getitem__` 从数据集中给定的索引 ``idx`` 处加载并返回一个样本。根据索引可以确定图像在硬盘上的位置,用 ``read_image`` 将其转换为tensor,从 ``self.img_labels`` 的csv数据中获取相应的标签,再对它们调用 transform 函数(如果适用),并返回tensor图像和相应的标签的元组。

```py
def __getitem__(self, idx):
Expand Down

0 comments on commit 31d7101

Please sign in to comment.