class_docstr: Pytorch backend datasets. 
class_docstr_tok: ["Pytorch","backend","datasets","."]
code: def __len__(self):
      return self.X.shape[0]
  
imports: import os
  import random
  from typing import List, Dict, Callable, Union, Optional, TYPE_CHECKING
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.data import DataLoader, Dataset
  from alibi.explainers.backends.cfrl_base import CounterfactualRLDataset
  from alibi.models.pytorch.actor_critic import Actor, Critic
label_desc: Use image node_id 2 for calling the PtCounterfactualRLDataset obj's underlying member method code with example usage: obj.__len__() and returns: self