| import torch | |
| device = torch.device('cuda') | |
| def evaluate(model, trajectory, num_steps=None): | |
| """Performs model rollouts and create stats.""" | |
| prediction = model(trajectory, is_training=False) | |
| traj_ops = { | |
| 'cells': trajectory['cells'], | |
| 'mesh_pos': trajectory['mesh_pos'], | |
| 'gt_fatigue_life': trajectory['fatigue_life'], | |
| 'pred_fatigue_life': prediction, | |
| 'node_type': trajectory['node_type'] | |
| } | |
| return traj_ops |