Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.io.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.io.base
Commits
b400b67a
Commit
b400b67a
authored
3 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Fix a deprecation warning and add better assert messages
parent
3f323d61
No related branches found
No related tags found
No related merge requests found
Pipeline
#59516
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/io/base/__init__.py
+3
-3
3 additions, 3 deletions
bob/io/base/__init__.py
with
3 additions
and
3 deletions
bob/io/base/__init__.py
+
3
−
3
View file @
b400b67a
...
@@ -137,7 +137,7 @@ def load(inputs):
...
@@ -137,7 +137,7 @@ def load(inputs):
The data loaded from the given ``inputs``.
The data loaded from the given ``inputs``.
"""
"""
from
collections
import
Iterable
from
collections
.abc
import
Iterable
import
numpy
import
numpy
if
_is_string
(
inputs
):
if
_is_string
(
inputs
):
if
not
os
.
path
.
exists
(
inputs
):
if
not
os
.
path
.
exists
(
inputs
):
...
@@ -401,9 +401,9 @@ def _generate_features(reader, paths, same_size=False):
...
@@ -401,9 +401,9 @@ def _generate_features(reader, paths, same_size=False):
else
:
else
:
# make sure all features have the same shape and dtype
# make sure all features have the same shape and dtype
if
same_size
:
if
same_size
:
assert
shape
==
list
(
feature
.
shape
)
assert
shape
==
list
(
feature
.
shape
)
,
f
"
Expected feature shape of
{
shape
}
, got
{
feature
.
shape
}
"
else
:
else
:
assert
shape
[
1
:]
==
list
(
feature
.
shape
[
1
:])
assert
shape
[
1
:]
==
list
(
feature
.
shape
[
1
:])
,
f
"
Ignoring first dimension, expected feature shape of
{
shape
}
, got
{
feature
.
shape
}
"
assert
dtype
==
feature
.
dtype
assert
dtype
==
feature
.
dtype
if
same_size
:
if
same_size
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment