这是indexloc提供的服务,不要输入任何密码
Skip to content

Make Batch.__eq__ work also for scalar values (0-dimensional arrays) #1182

@dantp-ai

Description

@dantp-ai

As first noticed here #1086 (comment), DeepDiff which is currently used for batch equality cannot handle 0-dimensional arrays.

My current proposal is to leverage np.atleast_1d and the newest Batch API's Batch.apply_values_transform to convert any 0-dimensional arrays to 1-d while keeping the others as they are (cf. #1086 (comment)).

Metadata

Metadata

Assignees

Labels

Batch and BufferImprovements in internal data structures, temporary label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions