Skip to content

Commit

Permalink
Fix device compatibility issue in initialize_from_another_model
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim137 committed May 7, 2024
1 parent 70b7b8d commit 96769e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kan/KAN.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ def initialize_from_another_model(self, another_model, x):
tensor(-0.0030)
tensor(0.0506)
'''
another_model(x) # get activations
another_model(x.to(another_model.device)) # get activations
batch = x.shape[0]

self.initialize_grid_from_another_model(another_model, x)
self.initialize_grid_from_another_model(another_model, x.to(another_model.device))

for l in range(self.depth):
spb = self.act_fun[l]
Expand Down

0 comments on commit 96769e1

Please sign in to comment.