Skip to content

Commit

Permalink
Merge pull request #115 from Jim137/Develop
Browse files Browse the repository at this point in the history
Fix device compatibility issue in `KAN.initialize_from_another_model`
  • Loading branch information
KindXiaoming authored May 8, 2024
2 parents 70b7b8d + 96769e1 commit cc507e3
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 cc507e3

Please sign in to comment.