{"action":"closed","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/3891","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/3891/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/3891/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/3891/events","html_url":"https://github.com/fchollet/keras/issues/3891","id":179560388,"number":3891,"title":"set_floatx does not work properly","user":{"login":"danielS91","id":12804361,"avatar_url":"https://avatars.githubusercontent.com/u/12804361?v=3","gravatar_id":"","url":"https://api.github.com/users/danielS91","html_url":"https://github.com/danielS91","followers_url":"https://api.github.com/users/danielS91/followers","following_url":"https://api.github.com/users/danielS91/following{/other_user}","gists_url":"https://api.github.com/users/danielS91/gists{/gist_id}","starred_url":"https://api.github.com/users/danielS91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielS91/subscriptions","organizations_url":"https://api.github.com/users/danielS91/orgs","repos_url":"https://api.github.com/users/danielS91/repos","events_url":"https://api.github.com/users/danielS91/events{/privacy}","received_events_url":"https://api.github.com/users/danielS91/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-27T17:31:30Z","updated_at":"2016-12-17T00:59:01Z","closed_at":"2016-12-17T00:59:01Z","body":"Once keras and the backend is imported, it is not possible to change the float type using 'set_floatx()'.\n\nSo running the following code snippet:\n\n``` python\nimport keras\nprint(keras.backend.floatx())\nkeras.backend.set_floatx('float16')\nprint(keras.backend.floatx())\n\n# create dummy variable as internally used for weights etc.\na = keras.backend.variable([10])\nprint(a.dtype)\n```\n\nwill result in:\n\n```\nfloat32\nfloat16\nfloat32\n```\n\n(only tested with theano backend, but with tensorflow backend it should be the same)\n\nIs this the desired behaviour and 'set_floatx()' only for internal use?\nOtherwise the backends should request the current float type by calling 'floatx()' instead of using a default value which is set once.\n"}}
{"actor":{"display_login":"fchollet"}}