Skip to content

Commit

Permalink
minor javadoc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu committed Nov 18, 2022
1 parent 7f0f18f commit 72ec1e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ public class ImageClassificationTranslatorFactory
EXPANSIONS.put(new Pair<>(Input.class, Output.class), ImageServingTranslator::new);
}

/** {@inheritDoc} */
@Override
protected Translator<Image, Classifications> buildBaseTranslator(
Model model, Map<String, ?> arguments) {
return ImageClassificationTranslator.builder(arguments).build();
}

/** {@inheritDoc} */
@Override
protected Map<Pair<Type, Type>, Function<Translator<Image, Classifications>, Translator<?, ?>>>
getExpansions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ public <I, O> Translator<I, O> newInstance(
return newInstance(input, output, baseTranslator);
}

/** {@inheritDoc} */
@SuppressWarnings("unchecked")
public <I, O> Translator<I, O> newInstance(
<I, O> Translator<I, O> newInstance(
Class<I> input, Class<O> output, Translator<IbaseT, ObaseT> translator) {
Function<Translator<IbaseT, ObaseT>, Translator<?, ?>> expansion =
getExpansions().get(new Pair<>(input, output));
Expand Down Expand Up @@ -84,17 +83,20 @@ protected abstract Translator<IbaseT, ObaseT> buildBaseTranslator(
getExpansions();

final class ExpandedTranslatorOptions implements TranslatorOptions {

private Translator<IbaseT, ObaseT> translator;

private ExpandedTranslatorOptions(Translator<IbaseT, ObaseT> translator) {
this.translator = translator;
}

/** {@inheritDoc} */
@Override
public Set<Pair<Type, Type>> getOptions() {
return getSupportedTypes();
}

/** {@inheritDoc} */
@Override
public <I, O> Translator<I, O> option(Class<I> input, Class<O> output) {
return newInstance(input, output, translator);
Expand Down

0 comments on commit 72ec1e1

Please sign in to comment.