{"action":"created","comment":{"url":"https://api.github.com/repos/intel-analytics/BigDL/pulls/comments/168091060","pull_request_review_id":96400571,"id":168091060,"diff_hunk":"@@ -114,38 +108,27 @@ trait ModelSerializer extends GraphSerializable with TKerasSerializerHelper{\n   }\n }\n \n-class Sequential[T: ClassTag](val stopInferShape: Boolean = false)\n-(implicit ev: TensorNumeric[T]) extends TSequential[T] {\n-\n-  override private[bigdl] def isCompatibleWithKeras(): Boolean = true\n-\n-  override private[bigdl] def isCompatibleWithTorch(): Boolean = false\n+class Sequential[T: ClassTag]()\n+(implicit ev: TensorNumeric[T]) extends KerasLayer[Activity, Activity, T] {\n \n   private[bigdl] var frozen: Boolean = false","path":"spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/keras/Topology.scala","position":50,"original_position":50,"commit_id":"8b57e8a3d7202b373c5250307d72d8eee038b5a4","original_commit_id":"8b57e8a3d7202b373c5250307d72d8eee038b5a4","user":{"login":"zhichao-li","id":2662017,"avatar_url":"https://avatars3.githubusercontent.com/u/2662017?v=4","gravatar_id":"","url":"https://api.github.com/users/zhichao-li","html_url":"https://github.com/zhichao-li","followers_url":"https://api.github.com/users/zhichao-li/followers","following_url":"https://api.github.com/users/zhichao-li/following{/other_user}","gists_url":"https://api.github.com/users/zhichao-li/gists{/gist_id}","starred_url":"https://api.github.com/users/zhichao-li/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhichao-li/subscriptions","organizations_url":"https://api.github.com/users/zhichao-li/orgs","repos_url":"https://api.github.com/users/zhichao-li/repos","events_url":"https://api.github.com/users/zhichao-li/events{/privacy}","received_events_url":"https://api.github.com/users/zhichao-li/received_events","type":"User","site_admin":false},"body":"Let's think of bellowing scenario:\r\n```\r\nmodel = Sequential()\r\nseq = Sequential()\r\nmodel.add(seq)\r\nseq.add(Dense(10)) // we should throw exception here, but \"isUsed\" is false for Dense(10) \r\n```","created_at":"2018-02-14T07:08:05Z","updated_at":"2018-02-14T07:08:06Z","html_url":"https://github.com/intel-analytics/BigDL/pull/2293#discussion_r168091060","pull_request_url":"https://api.github.com/repos/intel-analytics/BigDL/pulls/2293","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/intel-analytics/BigDL/pulls/comments/168091060"},"html":{"href":"https://github.com/intel-analytics/BigDL/pull/2293#discussion_r168091060"},"pull_request":{"href":"https://api.github.com/repos/intel-analytics/BigDL/pulls/2293"}},"in_reply_to_id":167874733},"pull_request":{"url":"https://api.github.com/repos/intel-analytics/BigDL/pulls/2293","id":168176555,"html_url":"https://github.com/intel-analytics/BigDL/pull/2293","diff_url":"https://github.com/intel-analytics/BigDL/pull/2293.diff","patch_url":"https://github.com/intel-analytics/BigDL/pull/2293.patch","issue_url":"https://api.github.com/repos/intel-analytics/BigDL/issues/2293","number":2293,"state":"open","locked":false,"title":"Enhance and refactor the logic of InferShape","user":{"login":"zhichao-li","id":2662017,"avatar_url":"https://avatars3.githubusercontent.com/u/2662017?v=4","gravatar_id":"","url":"https://api.github.com/users/zhichao-li","html_url":"https://github.com/zhichao-li","followers_url":"https://api.github.com/users/zhichao-li/followers","following_url":"https://api.github.com/users/zhichao-li/following{/other_user}","gists_url":"https://api.github.com/users/zhichao-li/gists{/gist_id}","starred_url":"https://api.github.com/users/zhichao-li/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhichao-li/subscriptions","organizations_url":"https://api.github.com/users/zhichao-li/orgs","repos_url":"https://api.github.com/users/zhichao-li/repos","events_url":"https://api.github.com/users/zhichao-li/events{/privacy}","received_events_url":"https://api.github.com/users/zhichao-li/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n- Enhance the checking for mix use of keras layer and torch layer.\r\n- Change the outputShape from Array[Shape] to be Shape.\r\n- final `getInputShape` and `getOutputShape` as we do not go through building process while reload model from file. `InputShapeValue` and `outputShapeValue` is the final answer.\r\n- Compare the inputShape from user with the shape from the building stage. \r\n- Add flag into `InferShape` to identify if this layer being used or not\r\n- `Sequential` should be frozen once being used in `add` or `inputs` \r\n## How was this patch tested?\r\nunittest\r\n## Related links or issues (optional)\r\nfixed https://github.com/intel-analytics/BigDL/issues/2281\r\n\r\n","created_at":"2018-02-09T08:10:29Z","updated_at":"2018-02-14T07:08:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad4d5fd3543596dac4970cca79684cd936b29716","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/intel-analytics/BigDL/pulls/2293/commits","review_comments_url":"https://api.github.com/repos/intel-analytics/BigDL/pulls/2293/comments","review_comment_url":"https://api.github.com/repos/intel-analytics/BigDL/pulls/comments{/number}","comments_url":"https://api.github.com/repos/intel-analytics/BigDL/issues/2293/comments","statuses_url":"https://api.github.com/repos/intel-analytics/BigDL/statuses/8b57e8a3d7202b373c5250307d72d8eee038b5a4","head":{"label":"zhichao-li:refactor","ref":"refactor","sha":"8b57e8a3d7202b373c5250307d72d8eee038b5a4","user":{"login":"zhichao-li","id":2662017,"avatar_url":"https://avatars3.githubusercontent.com/u/2662017?v=4","gravatar_id":"","url":"https://api.github.com/users/zhichao-li","html_url":"https://github.com/zhichao-li","followers_url":"https://api.github.com/users/zhichao-li/followers","following_url":"https://api.github.com/users/zhichao-li/following{/other_user}","gists_url":"https://api.github.com/users/zhichao-li/gists{/gist_id}","starred_url":"https://api.github.com/users/zhichao-li/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhichao-li/subscriptions","organizations_url":"https://api.github.com/users/zhichao-li/orgs","repos_url":"https://api.github.com/users/zhichao-li/repos","events_url":"https://api.github.com/users/zhichao-li/events{/privacy}","received_events_url":"https://api.github.com/users/zhichao-li/received_events","type":"User","site_admin":false},"repo":{"id":80885247,"name":"BigDL","full_name":"zhichao-li/BigDL","owner":{"login":"zhichao-li","id":2662017,"avatar_url":"https://avatars3.githubusercontent.com/u/2662017?v=4","gravatar_id":"","url":"https://api.github.com/users/zhichao-li","html_url":"https://github.com/zhichao-li","followers_url":"https://api.github.com/users/zhichao-li/followers","following_url":"https://api.github.com/users/zhichao-li/following{/other_user}","gists_url":"https://api.github.com/users/zhichao-li/gists{/gist_id}","starred_url":"https://api.github.com/users/zhichao-li/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhichao-li/subscriptions","organizations_url":"https://api.github.com/users/zhichao-li/orgs","repos_url":"https://api.github.com/users/zhichao-li/repos","events_url":"https://api.github.com/users/zhichao-li/events{/privacy}","received_events_url":"https://api.github.com/users/zhichao-li/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zhichao-li/BigDL","description":"BigDL: Distributed Deep Learning Library for Apache Spark","fork":true,"url":"https://api.github.com/repos/zhichao-li/BigDL","forks_url":"https://api.github.com/repos/zhichao-li/BigDL/forks","keys_url":"https://api.github.com/repos/zhichao-li/BigDL/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhichao-li/BigDL/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhichao-li/BigDL/teams","hooks_url":"https://api.github.com/repos/zhichao-li/BigDL/hooks","issue_events_url":"https://api.github.com/repos/zhichao-li/BigDL/issues/events{/number}","events_url":"https://api.github.com/repos/zhichao-li/BigDL/events","assignees_url":"https://api.github.com/repos/zhichao-li/BigDL/assignees{/user}","branches_url":"https://api.github.com/repos/zhichao-li/BigDL/branches{/branch}","tags_url":"https://api.github.com/repos/zhichao-li/BigDL/tags","blobs_url":"https://api.github.com/repos/zhichao-li/BigDL/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhichao-li/BigDL/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhichao-li/BigDL/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhichao-li/BigDL/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhichao-li/BigDL/statuses/{sha}","languages_url":"https://api.github.com/repos/zhichao-li/BigDL/languages","stargazers_url":"https://api.github.com/repos/zhichao-li/BigDL/stargazers","contributors_url":"https://api.github.com/repos/zhichao-li/BigDL/contributors","subscribers_url":"https://api.github.com/repos/zhichao-li/BigDL/subscribers","subscription_url":"https://api.github.com/repos/zhichao-li/BigDL/subscription","commits_url":"https://api.github.com/repos/zhichao-li/BigDL/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhichao-li/BigDL/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhichao-li/BigDL/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhichao-li/BigDL/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhichao-li/BigDL/contents/{+path}","compare_url":"https://api.github.com/repos/zhichao-li/BigDL/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhichao-li/BigDL/merges","archive_url":"https://api.github.com/repos/zhichao-li/BigDL/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhichao-li/BigDL/downloads","issues_url":"https://api.github.com/repos/zhichao-li/BigDL/issues{/number}","pulls_url":"https://api.github.com/repos/zhichao-li/BigDL/pulls{/number}","milestones_url":"https://api.github.com/repos/zhichao-li/BigDL/milestones{/number}","notifications_url":"https://api.github.com/repos/zhichao-li/BigDL/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhichao-li/BigDL/labels{/name}","releases_url":"https://api.github.com/repos/zhichao-li/BigDL/releases{/id}","deployments_url":"https://api.github.com/repos/zhichao-li/BigDL/deployments","created_at":"2017-02-04T01:53:45Z","updated_at":"2017-02-04T01:53:48Z","pushed_at":"2018-02-13T08:30:57Z","git_url":"git://github.com/zhichao-li/BigDL.git","ssh_url":"git@github.com:zhichao-li/BigDL.git","clone_url":"https://github.com/zhichao-li/BigDL.git","svn_url":"https://github.com/zhichao-li/BigDL","homepage":"","size":296040,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"intel-analytics:master","ref":"master","sha":"4999c15101ea0a5f116b370897a174fe5e0eed64","user":{"login":"intel-analytics","id":10941215,"avatar_url":"https://avatars3.githubusercontent.com/u/10941215?v=4","gravatar_id":"","url":"https://api.github.com/users/intel-analytics","html_url":"https://github.com/intel-analytics","followers_url":"https://api.github.com/users/intel-analytics/followers","following_url":"https://api.github.com/users/intel-analytics/following{/other_user}","gists_url":"https://api.github.com/users/intel-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/intel-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intel-analytics/subscriptions","organizations_url":"https://api.github.com/users/intel-analytics/orgs","repos_url":"https://api.github.com/users/intel-analytics/repos","events_url":"https://api.github.com/users/intel-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/intel-analytics/received_events","type":"Organization","site_admin":false},"repo":{"id":66823715,"name":"BigDL","full_name":"intel-analytics/BigDL","owner":{"login":"intel-analytics","id":10941215,"avatar_url":"https://avatars3.githubusercontent.com/u/10941215?v=4","gravatar_id":"","url":"https://api.github.com/users/intel-analytics","html_url":"https://github.com/intel-analytics","followers_url":"https://api.github.com/users/intel-analytics/followers","following_url":"https://api.github.com/users/intel-analytics/following{/other_user}","gists_url":"https://api.github.com/users/intel-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/intel-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intel-analytics/subscriptions","organizations_url":"https://api.github.com/users/intel-analytics/orgs","repos_url":"https://api.github.com/users/intel-analytics/repos","events_url":"https://api.github.com/users/intel-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/intel-analytics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/intel-analytics/BigDL","description":"BigDL: Distributed Deep Learning Library for Apache Spark","fork":false,"url":"https://api.github.com/repos/intel-analytics/BigDL","forks_url":"https://api.github.com/repos/intel-analytics/BigDL/forks","keys_url":"https://api.github.com/repos/intel-analytics/BigDL/keys{/key_id}","collaborators_url":"https://api.github.com/repos/intel-analytics/BigDL/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/intel-analytics/BigDL/teams","hooks_url":"https://api.github.com/repos/intel-analytics/BigDL/hooks","issue_events_url":"https://api.github.com/repos/intel-analytics/BigDL/issues/events{/number}","events_url":"https://api.github.com/repos/intel-analytics/BigDL/events","assignees_url":"https://api.github.com/repos/intel-analytics/BigDL/assignees{/user}","branches_url":"https://api.github.com/repos/intel-analytics/BigDL/branches{/branch}","tags_url":"https://api.github.com/repos/intel-analytics/BigDL/tags","blobs_url":"https://api.github.com/repos/intel-analytics/BigDL/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/intel-analytics/BigDL/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/intel-analytics/BigDL/git/refs{/sha}","trees_url":"https://api.github.com/repos/intel-analytics/BigDL/git/trees{/sha}","statuses_url":"https://api.github.com/repos/intel-analytics/BigDL/statuses/{sha}","languages_url":"https://api.github.com/repos/intel-analytics/BigDL/languages","stargazers_url":"https://api.github.com/repos/intel-analytics/BigDL/stargazers","contributors_url":"https://api.github.com/repos/intel-analytics/BigDL/contributors","subscribers_url":"https://api.github.com/repos/intel-analytics/BigDL/subscribers","subscription_url":"https://api.github.com/repos/intel-analytics/BigDL/subscription","commits_url":"https://api.github.com/repos/intel-analytics/BigDL/commits{/sha}","git_commits_url":"https://api.github.com/repos/intel-analytics/BigDL/git/commits{/sha}","comments_url":"https://api.github.com/repos/intel-analytics/BigDL/comments{/number}","issue_comment_url":"https://api.github.com/repos/intel-analytics/BigDL/issues/comments{/number}","contents_url":"https://api.github.com/repos/intel-analytics/BigDL/contents/{+path}","compare_url":"https://api.github.com/repos/intel-analytics/BigDL/compare/{base}...{head}","merges_url":"https://api.github.com/repos/intel-analytics/BigDL/merges","archive_url":"https://api.github.com/repos/intel-analytics/BigDL/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/intel-analytics/BigDL/downloads","issues_url":"https://api.github.com/repos/intel-analytics/BigDL/issues{/number}","pulls_url":"https://api.github.com/repos/intel-analytics/BigDL/pulls{/number}","milestones_url":"https://api.github.com/repos/intel-analytics/BigDL/milestones{/number}","notifications_url":"https://api.github.com/repos/intel-analytics/BigDL/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/intel-analytics/BigDL/labels{/name}","releases_url":"https://api.github.com/repos/intel-analytics/BigDL/releases{/id}","deployments_url":"https://api.github.com/repos/intel-analytics/BigDL/deployments","created_at":"2016-08-29T07:59:50Z","updated_at":"2018-02-13T21:50:15Z","pushed_at":"2018-02-14T07:07:01Z","git_url":"git://github.com/intel-analytics/BigDL.git","ssh_url":"git@github.com:intel-analytics/BigDL.git","clone_url":"https://github.com/intel-analytics/BigDL.git","svn_url":"https://github.com/intel-analytics/BigDL","homepage":"https://bigdl-project.github.io/","size":18829,"stargazers_count":2279,"watchers_count":2279,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":502,"mirror_url":null,"archived":false,"open_issues_count":155,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":502,"open_issues":155,"watchers":2279,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/intel-analytics/BigDL/pulls/2293"},"html":{"href":"https://github.com/intel-analytics/BigDL/pull/2293"},"issue":{"href":"https://api.github.com/repos/intel-analytics/BigDL/issues/2293"},"comments":{"href":"https://api.github.com/repos/intel-analytics/BigDL/issues/2293/comments"},"review_comments":{"href":"https://api.github.com/repos/intel-analytics/BigDL/pulls/2293/comments"},"review_comment":{"href":"https://api.github.com/repos/intel-analytics/BigDL/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/intel-analytics/BigDL/pulls/2293/commits"},"statuses":{"href":"https://api.github.com/repos/intel-analytics/BigDL/statuses/8b57e8a3d7202b373c5250307d72d8eee038b5a4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zhichao-li"}}