forked from mindspore-Ecosystem/mindspore
!48937 Provide len() method for the minddata dataset class interface
Merge pull request !48937 from 刘勇琪/master-decrypt-column
This commit is contained in:
commit
f27abc1e06
|
@ -1853,6 +1853,15 @@ class Dataset:
|
||||||
def parse(self, children=None):
|
def parse(self, children=None):
|
||||||
raise NotImplementedError("Dataset has to implement parse method.")
|
raise NotImplementedError("Dataset has to implement parse method.")
|
||||||
|
|
||||||
|
def __len__(self):
|
||||||
|
"""
|
||||||
|
Get the length of dataset.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int, the length of dataset.
|
||||||
|
"""
|
||||||
|
return self.get_dataset_size()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _update_data_shard(num_shards, shard_id):
|
def _update_data_shard(num_shards, shard_id):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue