-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support uniform api and sigmoid api in new AD #46960
Support uniform api and sigmoid api in new AD #46960
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
max_value = op.attr('max') | ||
seed = op.attr('seed') | ||
dtype = convert_np_dtype_to_dtype_( | ||
convert_dtype(INT_DTYPE_2_STRING[op.attr('dtype')])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paddle.dtype(op.attr('dtype'))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
seed, | ||
shape=op.attr('shape'), | ||
shape_t=None, | ||
shape_tl=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此处不用写三个分支,shape_tl/shape_t不存在同时不为None的情况,直接返回就行
return uniform_random(dtype,
min_value,
max_value,
seed,
shape=op.attr('shape'),
shape_t=shape_t,
shape_tl=shape_tl)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments
class UniformRandomPrimOpShapeInference : public framework::InferShapeBase { | ||
public: | ||
void operator()(framework::InferShapeContext *ctx) const override { | ||
// framework::InferShapeVarPtr y_var_ptr = ctx->GetOutputVarPtrs("Y")[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove useless code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
class UniformRandomPrimOpMaker : public framework::OpProtoAndCheckerMaker { | ||
public: | ||
void Make() override { | ||
AddInput("ShapeTensor", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this cause dynamic shape error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes,it has been deleted.
…nd add sigmoid orig2prim rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
OPs
Describe
Add
uniform_random_p
autograd primitive op and support orig2prim for paddle originaluniform_random
op andsigmoid
op.