Skip to content
Snippets Groups Projects
Unverified Commit d2ee824d authored by daquexian's avatar daquexian Committed by GitHub
Browse files

make parameter local for now (#4746)


Signed-off-by: default avatardaquexian <daquexian566@gmail.com>

Co-authored-by: default avataroneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
parent 8b0abc80
No related branches found
No related tags found
No related merge requests found
......@@ -23,10 +23,11 @@ class Parameter(Tensor):
def __init__(self, data, requires_grad=True):
# TODO: uncomment this line when autograd is ready
# data.requires_grad = True
data.set_is_consistent(True)
# TODO: set a proper placement
data.set_placement(flow.placement("gpu", ["0:0"], None))
# TODO: uncomment the following two lines when consistent <-> local conversion is ready
# data.set_is_consistent(True)
# data.set_placement(flow.placement("gpu", ["0:0"], None))
self._data = data
self._data.requires_grad = requires_grad
def __getattr__(self, name):
return getattr(self._data, name)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment