Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
f3d5e85d
Commit
f3d5e85d
authored
Sep 11, 2018
by
vfdev
Committed by
Francisco Massa
Sep 11, 2018
Browse files
Update fakedata.py (#581)
Target `float` -> `long`
parent
152c2b3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchvision/datasets/fakedata.py
torchvision/datasets/fakedata.py
+1
-1
No files found.
torchvision/datasets/fakedata.py
View file @
f3d5e85d
...
@@ -40,7 +40,7 @@ class FakeData(data.Dataset):
...
@@ -40,7 +40,7 @@ class FakeData(data.Dataset):
rng_state
=
torch
.
get_rng_state
()
rng_state
=
torch
.
get_rng_state
()
torch
.
manual_seed
(
index
+
self
.
random_offset
)
torch
.
manual_seed
(
index
+
self
.
random_offset
)
img
=
torch
.
randn
(
*
self
.
image_size
)
img
=
torch
.
randn
(
*
self
.
image_size
)
target
=
torch
.
Tensor
(
1
).
rand
om_
(
0
,
self
.
num_classes
)[
0
]
target
=
torch
.
rand
int
(
0
,
self
.
num_classes
,
size
=
(
1
,),
dtype
=
torch
.
long
)[
0
]
torch
.
set_rng_state
(
rng_state
)
torch
.
set_rng_state
(
rng_state
)
# convert to PIL Image
# convert to PIL Image
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment