payload: {"action":"created","issue":{"url":"https://api.github.com/repos/GPflow/GPflow/issues/1179","repository_url":"https://api.github.com/repos/GPflow/GPflow","labels_url":"https://api.github.com/repos/GPflow/GPflow/issues/1179/labels{/name}","comments_url":"https://api.github.com/repos/GPflow/GPflow/issues/1179/comments","events_url":"https://api.github.com/repos/GPflow/GPflow/issues/1179/events","html_url":"https://github.com/GPflow/GPflow/issues/1179","id":533992434,"node_id":"MDU6SXNzdWU1MzM5OTI0MzQ=","number":1179,"title":"static shapes vs dynamic shapes","user":{"login":"marcoadurno","id":4450528,"node_id":"MDQ6VXNlcjQ0NTA1Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/4450528?v=4","gravatar_id":"","url":"https://api.github.com/users/marcoadurno","html_url":"https://github.com/marcoadurno","followers_url":"https://api.github.com/users/marcoadurno/followers","following_url":"https://api.github.com/users/marcoadurno/following{/other_user}","gists_url":"https://api.github.com/users/marcoadurno/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoadurno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoadurno/subscriptions","organizations_url":"https://api.github.com/users/marcoadurno/orgs","repos_url":"https://api.github.com/users/marcoadurno/repos","events_url":"https://api.github.com/users/marcoadurno/events{/privacy}","received_events_url":"https://api.github.com/users/marcoadurno/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/GPflow/GPflow/milestones/1","html_url":"https://github.com/GPflow/GPflow/milestone/1","labels_url":"https://api.github.com/repos/GPflow/GPflow/milestones/1/labels","id":4898808,"node_id":"MDk6TWlsZXN0b25lNDg5ODgwOA==","number":1,"title":"2.0 release","description":"gpflow2 out and into the world","creator":{"login":"condnsdmatters","id":6815729,"node_id":"MDQ6VXNlcjY4MTU3Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/6815729?v=4","gravatar_id":"","url":"https://api.github.com/users/condnsdmatters","html_url":"https://github.com/condnsdmatters","followers_url":"https://api.github.com/users/condnsdmatters/followers","following_url":"https://api.github.com/users/condnsdmatters/following{/other_user}","gists_url":"https://api.github.com/users/condnsdmatters/gists{/gist_id}","starred_url":"https://api.github.com/users/condnsdmatters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/condnsdmatters/subscriptions","organizations_url":"https://api.github.com/users/condnsdmatters/orgs","repos_url":"https://api.github.com/users/condnsdmatters/repos","events_url":"https://api.github.com/users/condnsdmatters/events{/privacy}","received_events_url":"https://api.github.com/users/condnsdmatters/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":1,"state":"open","created_at":"2019-12-03T11:50:39Z","updated_at":"2019-12-09T12:19:40Z","due_on":"2019-12-20T08:00:00Z","closed_at":null},"comments":7,"created_at":"2019-12-06T13:42:08Z","updated_at":"2019-12-10T19:23:26Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nThe codebase heavily relieson static shapes (eg t.shape) as opposed to dynamic shapes (eg tf.shape(t)). \r\n\r\n## Bug case:\r\nUsing static shapes makes it impossible to use unknown batch size:\r\n```\r\nimport tensorflow as tf\r\nimport gpflow\r\n\r\n@tf.function\r\ndef K_diag_dynamic(X):\r\n    variance = 1.0\r\n    return tf.fill(tf.shape(X)[:-1],tf.squeeze(variance))\r\n\r\n@tf.function\r\ndef K_diag_static(X):\r\n    variance = 1.0\r\n    return tf.fill(X.shape[:-1],tf.squeeze(variance))\r\n\r\nif __name__=='__main__':\r\n    K_diag_dynamic.get_concrete_function(X=tf.TensorSpec([None,2], tf.float64))\r\n    K_diag_static.get_concrete_function(X=tf.TensorSpec([None,2], tf.float64))\r\n```\r\nGetting the concrete function for ```K_diag``` succeeds when using dynamic shapes and throws when using static shapes. At the moment we often rely on static shapes, like [here](https://github.com/GPflow/GPflow/blob/develop/gpflow/kernels/stationaries.py#L61). Wouldn't be better to use dynamic shapes?\r\n\r\n\r\n## System information:\r\n\r\nPython version: 3.7\r\nTensorFlow installed from (source or binary): binary\r\nTensorFlow version (use command below): 'v2.0.0-rc2-26-g64c3d382ca', '2.0.0'\r\nGPflow installed from (source or binary): source\r\nGPflow version: develop, 24b5733\r\n\r\nBest Regards,\r\n\r\nMarco\r\n"},"comment":{"url":"https://api.github.com/repos/GPflow/GPflow/issues/comments/564203896","html_url":"https://github.com/GPflow/GPflow/issues/1179#issuecomment-564203896","issue_url":"https://api.github.com/repos/GPflow/GPflow/issues/1179","id":564203896,"node_id":"MDEyOklzc3VlQ29tbWVudDU2NDIwMzg5Ng==","user":{"login":"marcoadurno","id":4450528,"node_id":"MDQ6VXNlcjQ0NTA1Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/4450528?v=4","gravatar_id":"","url":"https://api.github.com/users/marcoadurno","html_url":"https://github.com/marcoadurno","followers_url":"https://api.github.com/users/marcoadurno/followers","following_url":"https://api.github.com/users/marcoadurno/following{/other_user}","gists_url":"https://api.github.com/users/marcoadurno/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoadurno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoadurno/subscriptions","organizations_url":"https://api.github.com/users/marcoadurno/orgs","repos_url":"https://api.github.com/users/marcoadurno/repos","events_url":"https://api.github.com/users/marcoadurno/events{/privacy}","received_events_url":"https://api.github.com/users/marcoadurno/received_events","type":"User","site_admin":false},"created_at":"2019-12-10T19:23:26Z","updated_at":"2019-12-10T19:23:26Z","author_association":"NONE","body":"@st-- yes, I worked on st/dynamic_shapes and I have the changes into a fork. Overall it's quite a lot of changes (always moving from static to dynamic shapes). Tests still run, are we happy to start like that? If so I can open PR."}}
other: {"actor":{"display_login":"marcoadurno"}}