Skip to content

Commit 3237c8d

Browse files
committed
fix remaining changes
1 parent 03a81b4 commit 3237c8d

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/datasets/commands/datasets_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from datasets.commands.dummy_data import DummyDataCommand
66
from datasets.commands.env import EnvironmentCommand
77
from datasets.commands.run_beam import RunBeamCommand
8-
from datasets.commands.test import CLITestCommand
8+
from datasets.commands.test import TestCommand
99
from datasets.utils.logging import set_verbosity_info
1010

1111

@@ -23,7 +23,7 @@ def main():
2323
# Register commands
2424
ConvertCommand.register_subcommand(commands_parser)
2525
EnvironmentCommand.register_subcommand(commands_parser)
26-
CLITestCommand.register_subcommand(commands_parser)
26+
TestCommand.register_subcommand(commands_parser)
2727
RunBeamCommand.register_subcommand(commands_parser)
2828
DummyDataCommand.register_subcommand(commands_parser)
2929

src/datasets/formatting/tf_formatter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ def _tensorize(self, value):
6565
def _recursive_tensorize(self, data_struct: dict):
6666
# support for nested types like struct of list of struct
6767
if isinstance(data_struct, (list, np.ndarray)):
68-
if data_struct.dtype == np.dtype(
69-
"object"
70-
): # tensorflow tensors can sometimes be instantied from an array of objects
68+
if data_struct.dtype == object: # tensorflow tensors can sometimes be instantied from an array of objects
7169
try:
7270
return self._tensorize(data_struct)
7371
except ValueError:

src/datasets/formatting/torch_formatter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ def _recursive_tensorize(self, data_struct: dict):
4646
# support for nested types like struct of list of struct
4747
if isinstance(data_struct, (list, np.ndarray)):
4848
data_struct = np.array(data_struct, copy=False)
49-
if data_struct.dtype == np.dtype(
50-
"object"
51-
): # pytorch tensors cannot be instantied from an array of objects
49+
if data_struct.dtype == object: # pytorch tensors cannot be instantied from an array of objects
5250
return [self.recursive_tensorize(substruct) for substruct in data_struct]
5351
return self._tensorize(data_struct)
5452

0 commit comments

Comments
 (0)