code: public static AllocationShape buildAllocationShape(INDArray array) {
          AllocationShape shape = new AllocationShape();
          shape.setDataType(array.data().dataType());
          shape.setLength(array.length());
          shape.setDataType(array.data().dataType());
  
          return shape;
      }
docs: This method returns AllocationShape for specific array, that takes in account its real shape: offset, length, etc
  
  @param array
  @return