AI Coding · OpenAI · Hard
Problem: Implement Matrix Multiplication Forward and Backward (PyTorch) You are given an interviewer-provided code skeleton. Complete the forward and backward operations for matrix multiplication. Let A be shaped (M, K) and B be shaped (K, N). Task 1: Forward Implement the forward operation so that it produces C. Task 2: Backward For an upstream gradient dC with shape (M, N), compute and return both gradients: dA = dC @ B^T, with shape (M, K) dB = A^T @ dC, with shape (K, N)…
Checking your access…