Customizing a TensorFlow operation
Implement a custom operation that uses Metal kernels to accelerate neural-network training performance.
Overview
Configure the sample code
Follow the instructions in Getting started with tensorflow-metal.
Install ffmpeg using
brew.
brew install ffmpegInstall the required Python packages.
pip install -r requirements.txtUse
maketo build the custom operation with Xcode.
cd hash_encoder
make
cd ..Run the sample.
python tiny_nerf_hash.pyView the resutls in the
result_nerf_hashfolder.
To compare the performance benefits provided by this sample, you can run the original NeRF sample code included with the project. View the resutls in the
result_nerf_mlpfolder.
python tiny_nerf_mlp.py