Algolux interview question

Write a pytorch code for a simple problem