How would you implement a custom layer in a deep learning framework using low-level tensor operations?