Full implementation of all forward and backward methods with both array inputs and device variables as parameters.
Proper handle of Type with compatibility checks.