Java Code Examples for org.tensorflow.framework.AttrValue#ListValue
The following examples show how to use
org.tensorflow.framework.AttrValue#ListValue .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AttributeConverter.java From vespa with Apache License 2.0 | 6 votes |
@Override public Optional<List<Value>> getList(String key) { if (attributeMap.containsKey(key)) { AttrValue attrValue = attributeMap.get(key); if (attrValue.getValueCase() == AttrValue.ValueCase.LIST) { AttrValue.ListValue listValue = attrValue.getList(); if ( ! listValue.getBList().isEmpty()) { return Optional.of(listValue.getBList().stream().map(BooleanValue::new).collect(Collectors.toList())); } if ( ! listValue.getIList().isEmpty()) { return Optional.of(listValue.getIList().stream().map(DoubleValue::new).collect(Collectors.toList())); } if ( ! listValue.getFList().isEmpty()) { return Optional.of(listValue.getFList().stream().map(DoubleValue::new).collect(Collectors.toList())); } // add the rest } } return Optional.empty(); }
Example 2
Source File: ExtractImagePatches.java From deeplearning4j with Apache License 2.0 | 4 votes |
private static int[] parseIntList(AttrValue.ListValue ilist){ //TF includes redundant leading and training 1s for kSizes, strides, rates (positions 0/3) return new int[]{(int)ilist.getI(1), (int)ilist.getI(2)}; }