Skip to content
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

Re-design the type system of Fluid #8336

Closed
wangkuiyi opened this issue Feb 9, 2018 · 2 comments
Closed

Re-design the type system of Fluid #8336

wangkuiyi opened this issue Feb 9, 2018 · 2 comments
Assignees

Comments

@wangkuiyi
Copy link
Collaborator

wangkuiyi commented Feb 9, 2018

POD Types

If we are going to support POD types, we need to register them into the VarDesc message:

message VarDesc {
  enum VarType {
    # POD types
    INT = 101;
    FP32 = 102;
    FP16 = 103;
    STRING = 104;

    # Less-plain types
    LOD_TENSOR = 1;
    SELECTED_ROWS = 2;
  }
  required string name = 1;

Less-plain First-class Types

Tensor, SelectedRows, LoDTensor are less plain, but first-class types in Fluid.

Channel is very plain but also first-class.

Block is also a first-class type currently used by control-flow operators.

Composite Types

We need the type array, so we can change TENSOR_ARRAY into array of tensors.

We need the type tuple, so we can use them in channels.

Array

message ArrayDesc {
  required VarDesc elem_type = 1;
}

In Python, we need to be able to create an array:

tensor = fluid.tensor(dtype=INT, 10, 20) # tensor<int> make_tensor(type, width, height)
tensor_array = fluid.make_array(fluid.tensor(dtype=INT, 100, 200, 300))
tensor_array.push_back(fluid.tensor(dtype=INT, 100, 200, 300))

Tuple

message TupleDesc {
  repeated VarDesc elem_types = 1;
}
  
@kavyasrinet
Copy link

@wangkuiyi I have created a project for this task : https://github.com/PaddlePaddle/Paddle/projects/53 and added the issue there as well.

@shanyi15
Copy link
Collaborator

您好,此issue在近一个月内暂无更新,我们将于今天内关闭。若在关闭后您仍需跟进提问,可重新开启此问题,我们将在24小时内回复您。因关闭带来的不便我们深表歉意,请您谅解~感谢您对PaddlePaddle的支持!
Hello, this issue has not been updated in the past month. We will close it today for the sake of other user‘s experience. If you still need to follow up on this question after closing, please feel free to reopen it. In that case, we will get back to you within 24 hours. We apologize for the inconvenience caused by the closure and thank you so much for your support of PaddlePaddle Group!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants