function standardizeArgs(inputs, initialState, constants, numConstants) {
	  if (Array.isArray(inputs)) {
	    if (initialState != null || constants != null) {
	      throw new ValueError('When inputs is an array, neither initialState or constants ' + 'should be provided');
	    }

	    if (numConstants != null) {
	      constants = inputs.slice(inputs.length - numConstants, inputs.length);
	      inputs = inputs.slice(0, inputs.length - numConstants);
	    }

	    if (inputs.length > 1) {
	      initialState = inputs.slice(1, inputs.length);
	    }

	    inputs = inputs[0];
	  }

	  function toListOrNull(x) {
	    if (x == null || Array.isArray(x)) {
	      return x;
	    } else {
	      return [x];
	    }
	  }

	  initialState = toListOrNull(initialState);
	  constants = toListOrNull(constants);
	  return {
	    inputs: inputs,
	    initialState: initialState,
	    constants: constants
	  };
	}
Standardize `apply()` args to a single list of tensor inputs.

When running a model loaded from file, the input tensors `initialState` and
`constants` are passed to `RNN.apply()` as part of `inputs` instead of the
dedicated kwargs fields. `inputs` consists of
`[inputs, initialState0, initialState1, ..., constant0, constant1]` in this
case.
This method makes sure that arguments are
separated and that `initialState` and `constants` are `Array`s of tensors
(or None).

@param inputs Tensor or `Array` of  tensors.
@param initialState Tensor or `Array` of tensors or `null`/`undefined`.
@param constants Tensor or `Array` of tensors or `null`/`undefined`.
@returns An object consisting of
  inputs: A tensor.
  initialState: `Array` of tensors or `null`.
  constants: `Array` of tensors or `null`.
@throws ValueError, if `inputs` is an `Array` but either `initialState` or
  `constants` is provided.