fix ps+keras without unique
Description
tfra rely on DistributedVariable to get the correct device placement i.e. ._get_on_device_or_primary method, however, this only returns device 0 under PSV2, It breaks the TFRA PS. This PR fix it by using resource var directly without the DistributedVariable, the unique backwards computation still has problem, let's fix it in another pr Co-authored-by: @MoFHeka
Fixes # (issue) https://github.com/tensorflow/recommenders-addons/issues/182 https://github.com/tensorflow/recommenders-addons/issues/401 https://github.com/tensorflow/recommenders-addons/issues/365
Type of change
- [ ] Bug fix
- [ ] New Tutorial
- [ ] Updated or additional documentation
- [ ] Additional Testing
- [ ] New Feature
Checklist:
- [ ] I've properly formatted my code according to the guidelines
- [ ] By running yapf
- [ ] By running clang-format
- [ ] This PR addresses an already submitted issue for TensorFlow Recommenders-Addons
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
How Has This Been Tested?
If you're adding a bugfix or new feature please describe the tests that you ran to verify your changes: *
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.