def teardown(self, hooks=True):
if not self.is_valid:<EOL><INDENT>raise PolyaxonDeploymentConfigError(<EOL>'<STR_LIT>'.format(self.deployment_type))<EOL><DEDENT>if self.is_kubernetes:<EOL><INDENT>self.teardown_on_kubernetes(hooks=hooks)<EOL><DEDENT>elif self.is_docker_compose:<EOL><INDENT>self.teardown_on_docker_compose()<EOL><DEDENT>elif self.is_docker:<EOL><INDENT>self.teardown_on_docker(hooks=hooks)<EOL><DEDENT>elif self.is_heroku:<EOL><INDENT>self.teardown_on_heroku(hooks=hooks)<EOL><DEDENT>
Teardown Polyaxon.