HDF keys and DatasetHDF5

how I can check the dimension of an HDF file and is it still an hdf file if its again passed another dataset HDF?
I have an hdf file which is again divided into trainset and testset as shown below but when I am trying to check the dimension of hdf it says HDF5 has no attribute “keys”

trainset = Dataset4DFromHDF5(args.data,

                                 labels=(ref_type,),
                                                          
                                 device=loader_device,

                                 start=args.intervals[0], 
                                 end=args.intervals[1],
                                 crop=args.crop,
                                 augment=args.img_augm,
                                 augment_freq=args.freq_augm)

testset = Dataset4DFromHDF5(args.data,
                                labels=(ref_type,),
                                device=loader_device,
                                start=args.intervals[2], 
                                end=args.intervals[3],
                                crop=args.crop,
                                augment=False,
                                augment_freq=False)

list(trainset.keys())

AttributeError: ‘DatasetDeepPhysHDF5’ object has no attribute ‘keys’

I don’t know how DatasetDeepPhysHDF5 is implemented, but would assume that it might be a custom torch.utils.data.Dataset, which wraps the HFD dataset internally, and is thus not implementing the keys() operation. You could check it via print(type(trainset)) and check which methods are implemented for this class.
If my guess is correct, you might be able to access the internal HDF dataset and call keys() on it directly.

thanks for feedback i will check it