Skip to content

Commit

Permalink
check if a tensor if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasColas committed Sep 4, 2023
1 parent 0372930 commit 629f575
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PokerPlus/DeepCFR/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def forward(self, cards, bets):
for embedding, card_group in zip(self.card_embeddings, cards):
print("do embedding")
print("card_group: ", card_group)
card_embs.append(embedding(card_group.view(1, -1)))
if card_group.numel():
card_embs.append(embedding(card_group.view(1, -1)))
card_embs = torch.cat(card_embs, dim=1)
x = F.relu(self.card1(card_embs))
x = F.relu(self.card2(x))
Expand Down

0 comments on commit 629f575

Please sign in to comment.