File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -260,8 +260,10 @@ def forward(self, x):
260
260
modes ["pv" ] = self .pv_encoder (x )
261
261
else :
262
262
# Target is PV, so only take the history
263
- x [BatchKey .pv ] = x [BatchKey .pv ][:, : self .history_len_30 ]
264
- modes ["pv" ] = self .pv_encoder (x )
263
+ # Copy batch
264
+ x_tmp = x .copy ()
265
+ x_tmp [BatchKey .pv ] = x_tmp [BatchKey .pv ][:, : self .history_len_30 ]
266
+ modes ["pv" ] = self .pv_encoder (x_tmp )
265
267
266
268
# *********************** GSP Data ************************************
267
269
# add gsp yield history
@@ -283,9 +285,10 @@ def forward(self, x):
283
285
modes ["wind" ] = self .wind_encoder (x )
284
286
else :
285
287
# Have to be its own Batch format
286
- x [BatchKey .wind ] = x [BatchKey .wind ][:, : self .history_len_30 ]
288
+ x_tmp = x .copy ()
289
+ x_tmp [BatchKey .wind ] = x_tmp [BatchKey .wind ][:, : self .history_len_30 ]
287
290
# This needs to be a Batch as input
288
- modes ["wind" ] = self .wind_encoder (x )
291
+ modes ["wind" ] = self .wind_encoder (x_tmp )
289
292
290
293
if self .include_sun :
291
294
sun = torch .cat (
You can’t perform that action at this time.
0 commit comments