Vk/tf issues#133 v3

This patch is a rework of pull request based on pull request vk/tf_issues#133