gpt4 book ai didi

python - Python中 ".."中的 "from ..engine import Layer"是什么意思?

转载 作者:行者123 更新时间:2023-12-01 02:43:15 25 4
gpt4 key购买 nike

在Keras源代码中,我看到了以下内容:

from ..engine import Layer

不知道是不是和下面的一样:

from ../engine import Layer

最佳答案

根据this文章,它来自相对导入:

Guido has Pronounced that relative imports will use leading dots. A single leading dot indicates a relative import, starting with the current package. Two or more leading dots give a relative import to the parent(s) of the current package, one level per dot after the first. Here's a sample package layout:

关于python - Python中 ".."中的 "from ..engine import Layer"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45475058/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com