Skip to content

Commit

Permalink
remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
cherryWangY committed Nov 8, 2024
1 parent 2016a94 commit d4fc7ef
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions deepmd/pt/model/descriptor/se_r.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def enable_compression(
if self.compress:
raise ValueError("Compression is already enabled.")
data = self.serialize()
self.table = DPTabulate(
table = DPTabulate(
self,
data["neuron"],
data["type_one_side"],
Expand All @@ -391,10 +391,10 @@ def enable_compression(
table_stride_2,
check_frequency,
]
lower, upper = self.table.build(
lower, upper = table.build(
min_nbor_dist, table_extrapolate, table_stride_1, table_stride_2
)
table_data = self.table.data
table_data = table.data

for ii, ll in enumerate(self.filter_layers.networks):
net = "filter_-1_net_" + str(ii)
Expand Down Expand Up @@ -494,16 +494,6 @@ def forward(
ss = ss * mm[:, :, None]
if self.compress:
ss = ss.squeeze(-1)
net = "filter_-1_net_" + str(ii)
info = [
self.lower[net],
self.upper[net],
self.upper[net] * self.table_config[0],
self.table_config[1],
self.table_config[2],
self.table_config[3],
]
tensor_data = self.table_data[net].to(ss.device).to(dtype=self.prec)
xyz_scatter = torch.ops.deepmd.tabulate_fusion_se_r(
compress_data_ii.contiguous(),
compress_info_ii.cpu().contiguous(),
Expand Down

0 comments on commit d4fc7ef

Please sign in to comment.