Skip to content

Commit

Permalink
Clear cached FSA properties when it labels are changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Nov 8, 2021
1 parent ceb8e50 commit de5b200
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions k2/torch/csrc/fsa_class.cu
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ void FsaClass::SetLabels(torch::Tensor labels) {
K2_CHECK_EQ(labels.scalar_type(), torch::kInt32);
K2_CHECK(ContextFromTensor(labels)->IsCompatible(*fsa.Context()));
Labels().copy_(labels);
properties = 0; // Clear cached properties as we changed the labels
}

void FsaClass::SetAttr(const std::string &name, torch::IValue value) {
Expand Down

0 comments on commit de5b200

Please sign in to comment.