(n_actions, legal_actions_list, device, dtype=torch.uint8)
return mask
Args:
        legal_actions_list (list):  List of legal actions as integers, where 0 is always FOLD, 1 is CHECK/CALL.
                                    2 is BET/RAISE for continuous PokerEnvs, and for DiscretePokerEnv subclasses,
                                    numbers greater than 1 are all the raise sizes.

        device (torch.device):      device the mask shall be put on

        dtype:                      dtype the mask shall have

    Returns:
        torch.Tensor:               a many-hot representation of the list of legal actions.
Args:
        legal_actions_list (list):  List of legal actions as integers, where 0 is always FOLD, 1 is CHECK/CALL.
                                    2 is BET/RAISE for continuous PokerEnvs, and for DiscretePokerEnv subclasses,
                                    numbers greater than 1 are all the raise sizes.
Args : legal_actions_list ( list ) : List of legal actions as integers where 0 is always FOLD 1 is CHECK / CALL . 2 is BET / RAISE for continuous PokerEnvs and for DiscretePokerEnv subclasses numbers greater than 1 are all the raise sizes .
def get_legal_action_mask_torch(n_actions, legal_actions_list, device, dtype=torch.uint8):
    """
    Args:
        legal_actions_list (list):  List of legal actions as integers, where 0 is always FOLD, 1 is CHECK/CALL.
                                    2 is BET/RAISE for continuous PokerEnvs, and for DiscretePokerEnv subclasses,
                                    numbers greater than 1 are all the raise sizes.

        device (torch.device):      device the mask shall be put on

        dtype:                      dtype the mask shall have

    Returns:
        torch.Tensor:               a many-hot representation of the list of legal actions.
    """
    idxs = torch.LongTensor(legal_actions_list, device=device)
    mask = torch.zeros((n_actions), device=device, dtype=dtype)
    mask[idxs] = 1
    return mask
def get_legal_action_mask_torch ( n_actions , legal_actions_list , device , dtype = torch . uint8 ) : idxs = torch . LongTensor ( legal_actions_list , device = device ) mask = torch . zeros ( ( n_actions ) , device = device , dtype = dtype ) mask [ idxs ] = 1 return mask