Comments (3)
You can implement this as x[1:3]. Do you need non-contiguous indices?
from knet.jl.
Currently only Integer, Range, or Colon indices are supported for KnetArray. To get the rest to work, we need to complete the missing getindex methods.
In Julia, a[[1,3,5]] calls:
getindex(A::AbstractArray, I...) at abstractarray.jl:751
_getindex(l::Base.LinearIndexing, A::AbstractArray, i::Union{AbstractArray,Colon,Real}) at multidimensional.jl:275
_unsafe_getindex(::Base.LinearIndexing, A::AbstractArray, I::Union{AbstractArray,Colon,Real}...) at multidimensional.jl:291
_unsafe_getindex!(dest::AbstractArray, src::AbstractArray, I::Union{AbstractArray,Colon,Real}...) at multidimensional.jl:340
and a[[true,false,true]] calls:
_unsafe_getindex(::Base.LinearFast, src::AbstractArray, I::AbstractArray{Bool,N<:Any}) at multidimensional.jl:321
These need to be ported to KnetArrays. We get them for free if we inherit from AbstractArray, but that has other problems such as inefficient operations getting called inadvertently on KnetArrays. However as a temporary workaround you can try modifying the type declaration of KnetArray in karray.jl to inherit from AbstractArray:
type KnetArray{T,N} <: AbstractArray
from knet.jl.
Implemented the following indexing options:
- 1-D: Int, Colon, UnitRange, StepRange, Array{Int}, BitArray, CartesianIndex, Array{CartesianIndex} (1-D includes linear indexing of multidimensional arrays)
- 2-D: (Colon,Union{Int,Colon,UnitRange,StepRange,Array{Int}}), (Union{Int,UnitRange,Colon}...) (in any order)
- N-D: (Int...)
The 1-D support is complete, 2-D and N-D are still missing a lot.
from knet.jl.
Related Issues (20)
- dropout seeds the global RNG
- MethodError: no method matching LinearIndices HOT 2
- ERROR: LoadError: KeyError: key :nw not found
- missing docstring error for "File I/O" section
- Making a new CUDA 3 compatible release? HOT 7
- Create a DeepMap.jl package
- Knet 1.4.7: libknet8 library not found HOT 4
- LoadError: Failed to precompile Knet [1902f260-5fb4-5aff-8c31-6271790ab950] to my julia directory HOT 3
- TagBot trigger issue HOT 2
- load/save problem with CuArrays in tutorial/60.rnn.ipynb HOT 2
- Derivative of a Function That Includes @diff Macro HOT 4
- R1 Regularization HOT 9
- type DataType has no field mutable HOT 2
- Quick Start tutorial notebook is broken HOT 1
- Cannot locate artifact 'libknet8' for aarch64-linux-gnu-libgfortran5-cxx11-libstdcxx29-julia_version+1.7.1 in Docker Container on Apple Silicon HOT 9
- Fix deprecations from MLDatasets in tutorial notebooks
- Problem with conv4 on gpu HOT 4
- UndefVarError: accuracy not defined in tutorial 30.lin.ipynb HOT 1
- CuArray{Float32} in ytype raised error HOT 4
- how to use the resnet modules in example folder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knet.jl.