Skip to content

Commit

Permalink
fix try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
tiankongdeguiji committed Jan 23, 2025
1 parent 2c031d8 commit bdcf38f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tzrec/datasets/data_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,9 @@ def _to_sparse_features(
seq_length = length
key_length = input_data[f"{key}.key_lengths"]
# TODO: remove to_float when segment_reduce support int values
try:
length = torch.segment_reduce(
key_length.float(), "sum", lengths=seq_length
).to(length.dtype)
except Exception:
import pdb

pdb.set_trace()
length = torch.segment_reduce(
key_length.float(), "sum", lengths=seq_length
).to(length.dtype)
mulval_keys.append(key)
mulval_seq_lengths.append(seq_length)
mulval_key_lengths.append(key_length)
Expand Down

0 comments on commit bdcf38f

Please sign in to comment.