code: func NewFilter(dataType DataType, format TensorFormat, shape []int) (retVal *Filter, err error) {
  	var internal C.cudnnFilterDescriptor_t
  	if err = result(C.cudnnCreateFilterDescriptor(&internal)); err != nil {
  		return nil, err
  	}
  	switch len(shape) {
  	case 0, 1, 2, 3:
  		return nil, errors.New("Cannot create filter with a shape < 4 dimensions")
  	case 4:
  		if err = result(C.cudnnSetFilter4dDescriptor(internal, dataType.C(), format.C(), C.int(shape[0]), C.int(shape[1]), C.int(shape[2]), C.int(shape[3]))); err != nil {
  			return nil, err
  		}
  	default:
  		filterDimA, filterDimAManaged := ints2CIntPtr(shape)
  		defer returnManaged(filterDimAManaged)
  		if err = result(C.cudnnSetFilterNdDescriptor(internal, dataType.C(), format.C(), C.int(len(shape)), filterDimA)); err != nil {
  			return nil, err
  		}
  	}
  	return &Filter{
  		internal: internal,
  		format:   format,
  		shape:    shape,
  	}, nil
  }
docs: // NewFilter creates a new Filter.