@@ -176,26 +176,34 @@ def compute_forces(self, lmp_data):
176176 self ._ensure_model_initialized () # lazy init
177177 assert self .model , 'Model must be initialized'
178178 if lmp_data .nlocal == 0 or lmp_data .npairs <= 1 :
179- # waht about a single atom with 0 pairs?
179+ # what about a single atom with 0 pairs?
180180 return
181181
182182 nlocal = lmp_data .nlocal
183183 ntotal = lmp_data .ntotal
184184
185185 # edge_vectors should be f32 in 7net
186- edge_vectors = torch .as_tensor (lmp_data .rij , torch .float32 , self .device )
186+ edge_vectors = torch .as_tensor (
187+ lmp_data .rij , dtype = torch .float32 , device = self .device
188+ )
187189 edge_vectors .requires_grad_ (True )
188190
189191 edge_index = torch .vstack (
190192 [
191- torch .as_tensor (lmp_data .pair_i , torch .int64 , self .device ),
192- torch .as_tensor (lmp_data .pair_j , torch .int64 , self .device ),
193+ torch .as_tensor (
194+ lmp_data .pair_i , dtype = torch .int64 , device = self .device
195+ ),
196+ torch .as_tensor (
197+ lmp_data .pair_j , dtype = torch .int64 , device = self .device
198+ ),
193199 ]
194200 )
195- elems = torch .as_tensor (lmp_data .elems , torch .int64 , self .device )
196- num_atoms = torch .as_tensor (nlocal , torch .int64 , self .device )
201+ elems = torch .as_tensor (
202+ lmp_data .elems , dtype = torch .int64 , device = self .device
203+ )
204+ num_atoms = torch .as_tensor (nlocal , dtype = torch .int64 , device = self .device )
197205 mliap_num_local_ghost = torch .as_tensor (
198- [nlocal , ntotal - nlocal ], torch .int64 , self .device
206+ [nlocal , ntotal - nlocal ], dtype = torch .int64 , device = self .device
199207 )
200208
201209 # data prep
0 commit comments