We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2f4afd commit 5458524Copy full SHA for 5458524
1 file changed
test/auto_parallel/high_order_grad.py
@@ -89,6 +89,7 @@ def __init__(self, num_sample):
89
def __getitem__(self, index):
90
x = np.linspace(0, 0.9, 10)
91
y = np.linspace(0, 0.9, 10)
92
+ np.random.seed(index) # Optional: Ensure reproducibility
93
bc_value = np.random.rand(36).reshape(36, 1).astype('float32')
94
95
domain_space = []
@@ -100,8 +101,9 @@ def __getitem__(self, index):
100
101
bc_index.append(i + 10 * j)
102
domain_space = np.array(domain_space, dtype='float32')
103
bc_index = np.array(bc_index, dtype='int64')
-
104
- return domain_space, bc_index, bc_value
+ # Return a single input point and its related information based on the index
105
+ idx = index % len(domain_space)
106
+ return domain_space[idx], bc_index, bc_value
107
108
def __len__(self):
109
return self.num_sample
0 commit comments