Set<InferenceVariable> (Set<InferenceVariable> inputVariables, InferenceSession session) { final HashSet<InferenceVariable> mentionedVariables = new HashSet<>(); session.collectDependencies(myT, mentionedVariables); if (inputVariables != null) { mentionedVariables.removeAll(inputVariables); } return mentionedVariables.isEmpty() ? null : mentionedVariables; }