if (o instanceof AVector) {
return (AVector)o;
} else if (o instanceof double[]) {
return Vectorz.create((double[])o);
} else if (o instanceof INDArray) {
INDArray a=(INDArray)o;
if (a.dimensionality()!=1) throw new IllegalArgumentException("Cannot coerce INDArray with shape "+a.getShape().toString()+" to a vector");
return a.asVector();
} else if (o instanceof List<?>) {
return Vectorz.create((List<Object>)o);
} else if (o instanceof Iterable<?>) {
return Vectorz.create((Iterable<Object>)o);
}