You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: AffineGridGenerator.m
    path of file: ./repos/2016_person_re-ID/matlab/+dagnn
    
    the code of the file until where you have to start completion: classdef AffineGridGenerator < dagnn.Layer
%DAGNN.AFFINEGRIDGENERATIOR  Generate an affine grid for bilinear resampling
%   This layer maps 1 x 1 x 6 x N affine transforms to 2 x Ho x Wo x N
%   sampling grids compatible with dagnn.BlilinearSampler.

% (c) 2016 Ankush Gupta

 properties
     Ho = 0;
     Wo = 0;
 end

  properties (Transient)
    % the grid (
    
function outputs = forward(obj, inputs, ~)
      % input is a 1x1x6xN TENSOR corresponding to:
      % [ c1 c2 c5 ]
      % [ c3 c4 c6 ]
      % [  0  0  1 ]
      % i.e., [d1] = [c1 c2]  * [d1] + [c5]
      %       [d2]   [c3 c4]    [d2]   [c6]
      % where, di is the i-th dimension.
      % 
      % OUTPUT is a 2xHoxWoxN grid which corresponds to applying
      % the above affine transform to the [-1,1] normalized x,y
      % coordinates.

      %fprintf('affineGridGenerator forward\n');
      useGPU = isa(inputs{1}, 'gpuArray');

      % reshape the tfm params into matrices:
      A = inputs{1};
      nbatch = size(A,4);
      A = reshape(A, 2,3,nbatch);
      L = A(:,1:2,:);
      L = reshape(L,2,2*nbatch); % linear part

      % generate the grid coordinates:
      if isempty(obj.xxyy)
        obj.initGrid(useGPU);
      end