MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / OpInputList

Class OpInputList

tensorflow/core/framework/op_kernel.h:472–488  ·  view source on GitHub ↗

Utility class for representing a list of immutable input tensors that are passed to the op as a single named argument.

Source from the content-addressed store, hash-verified

470// Utility class for representing a list of immutable input tensors
471// that are passed to the op as a single named argument.
472class OpInputList {
473 public:
474 typedef OpArgIterator<OpInputList, const Tensor> Iterator;
475 OpInputList() : ctx_(nullptr), start_(0), stop_(0) {}
476 OpInputList(OpKernelContext* ctx, int start, int stop)
477 : ctx_(ctx), start_(start), stop_(stop) {}
478 OpInputList& operator=(const OpInputList& other) = default;
479 const Tensor& operator[](int i) const;
480 int size() const { return stop_ - start_; }
481 Iterator begin() const { return Iterator(this, 0); }
482 Iterator end() const { return Iterator(this, size()); }
483
484 private:
485 OpKernelContext* ctx_; // not owned
486 int start_;
487 int stop_;
488};
489
490// Utility class for representing a list of mutable ("ref") input tensors
491// that are passed to the op as a single named argument.

Callers 1

input_listMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected