Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Category
Execute Infrastructure
PR Types
Bug fixes
Description
第四批-编号16(共1个)
__getitem__方法本应根据传入的index返回对应的一个样本或一组数据切片,但当前实现中完全忽略index参数,每次都重新生成整个网格空间(共100个点)以及边界条件索引(36个点)。这意味着无论index是多少,返回的数据都是完整且相同的结构,导致数据加载逻辑错误,破坏了 Dataset 的迭代机制。修复后的
__getitem__使用index来选择具体的输入点(例如 domain 中的某个坐标点),同时保留共享的边界信息(bc_index 和 bc_value)。这样每个样本可以独立访问,符合Dataset接口要求。此外,可通过种子控制随机性以保证可复现性。若需更复杂的采样策略,可在初始化时预生成所有样本。